I use a cron job to call offlineimap every 2 minutes:*/2 * * * * /usr/bin/offlineimap > ~/Maildir/offlineimap.log 2>&1I needed to kill the cron job to fix a problem. How can I then restart the cron job (without rebooting)? I found this 'solution' online:mylogin@myhost:~$ sudo /etc/init.d/cron restartRather than invoking init scripts through /etc/init.d, use the service(8)utility, e.g. service cron restartSince the script you are attempting to invoke has been converted to anUpstart job, you may also use the stop(8) and then start(8) utilities,e.g. stop cron ; start cron. The restart(8) utility is also available.cron stop/waitingcron start/running, process 26958However, using ps -ef | grep ..., I don't see the job... What's wrong?
How to start a cron job without reboot?
cron
Cron approachIf you have sudo privileges you could stop/start the cron service. I believe that's what that solution you found online was explaining. Depending on which Linux distro you're using you could either do these commands:# redhat distros$ sudo /etc/init.d/crond stop... do your work ...$ sudo /etc/init.d/crond startOr do these commands:# Debian/Ubuntu distros$ sudo service cron stop... do your work ...$ sudo service cron startLock file type approachYou could also put a dontrunofflineimap file in say the /tmp directory when you want the offlineimap task to hold off and not run for a bit.The process would work like this. You touch a file in /tmp like so:touch /tmp/dontrunofflineimapThe cron job would be modified like so:*/2 * * * * [ -f /tmp/dontrunofflineimap ] || /usr/bin/offlineimap > ~/Maildir/offlineimap.log 2>&1While that file exists, it will essentially block the offlineimap app from running. When you want it to resume, simply delete the /tmp/dontrunofflineimap file.