Firstly let’s just note that crontabs are read in the following way:
[code lang=”bash”]
* * * * * command to be executed
– – – – –
| | | | |
| | | | +—– day of week (0 – 6) (Sunday=0)
| | | +——- month (1 – 12)
| | +——— day of month (1 – 31)
| +———– hour (0 – 23)
+————- min (0 – 59)
[/code]

Your current crontabs can be viewed on your linux setup by typing in the following command:
[code lang=”bash”]
crontab -e
[/code]

Now to get to the point of this article, how would you temporarily disable a line/command without deleting the line? It’s quite simple actually, all you have to do is comment out that line / multiple lines by adding a hash in front of the line as follows:

Before:
[code lang=”bash”]
00 12 * * * php /var/www/example.com/crons/somecron.php
[/code]

After:
[code lang=”bash”]
# 00 12 * * * php /var/www/example.com/crons/somecron.php
[/code]

Wasn’t that easy?