Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly disable a single job in crontab [closed]

I need to quickly and temporarily disable a particular job in crontab under linux. How can I do that?

like image 907
Dariusz Avatar asked May 08 '15 07:05

Dariusz


People also ask

How do I clear a crontab file?

By default, crontab file protections are set up so that you cannot inadvertently delete a crontab file by using the rm command. Instead, use the crontab -r command to remove crontab files. By default, the crontab -r command removes your own crontab file.

What is the use of * * * * * In cron?

It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .


1 Answers

The quickest way would be to edit the crontab file and simply comment the job you want disabled. Comment lines in crontab start with a #.

0 0 1 * * this_job_i_want.sh

# uncomment below to enable
# 0 0 2 * * this_job_i_dont_want.sh
like image 144
Dariusz Avatar answered Oct 03 '22 14:10

Dariusz