Command to ON/OFF cron job

19,118

For the single cron job you can comment by editing with crontab -e.

If you have to stop all the cron jobs:

sudo service crond stop
sudo service crond status
sudo service crond restart

or

/etc/init.d/cron start
/etc/init.d/cron status
/etc/init.d/cron restart

or

sudo systemctl stop cron
sudo systemctl status cron
sudo systemctl restart cron
Share:
19,118

Related videos on Youtube

Praveen VT
Author by

Praveen VT

Am a Web Developer works mainly on core PHP, JS and MySQL. Currently am concentrating on real-estate online tool products.

Updated on September 18, 2022

Comments

  • Praveen VT
    Praveen VT over 1 year

    Is there any command that can switch ON/OFF cron job in Ubuntu?

    As far I know to open crontab -e and comment out each cron job. Is there any single command to stop all cron job and restart later?

    Currently I have multiple cron jobs running on different time to send email alerts, monitoring results, automatic DB update(hourly), weekly status etc

    But then during maintenance time, I need to stop all these cron jobs and restart once maintenance is over. Now disabling one by one with # symbol.

    Is there any solution?

  • hlongmore
    hlongmore over 5 years
    Or, use cron instead of crond in the first example (at least, that's what I had to do).