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
Related videos on Youtube
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, 2022Comments
-
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 over 5 yearsOr, use cron instead of crond in the first example (at least, that's what I had to do).