Hi together,
I would like to improve my current fetchmail crontab record.
Right now it just waits 10 seconds, checks if there is already running fetchmail process, exits if yes, fetches mail if no.
Code:
*/59 9-23 * * * bash -c "sleep 10; if pgrep fetchmail; then exit; else fetchmail --nosyslog --nodetach -vvv; fi" > /dev/null
What I'd like to do is wait 1 minute if fetchmail fails (happens with some servers sometimes) and then retry again, increase timeout before each next retry, exit if the amount of retries is more than 10.
Please advise. Thanks ahead.