Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just want to pause everything. Don't execute anything listed on crontab -l.

share|improve this question
up vote 21 down vote accepted

crontab -e then comment out each line you don't want to run with #.

share|improve this answer
oof...... this is the best solution the *nix community made over the years? – New Alexandria Oct 20 '12 at 14:08

First, back up the crontab:

crontab -l > my_cron_backup.txt

Then you can empty it:

crontab -r

To restore:

crontab my_cron_backup.txt
crontab -l
share|improve this answer
This is particularly helpful when /tmp is corrupted (and if your crontab -e uses mktemp in /tmp. – Kevin Lee Mar 23 '15 at 15:17
+1 Finally, this is what worked for me. Thank you – Pavan Jun 4 '15 at 23:25

Do you have root access? Just pause cron

sudo /etc/init.d/crond stop

Then restart it when you're ready

sudo /etc/init.d/crond start
share|improve this answer
That is assuming you want to stop crontab for all users including root. The selected answer, and kubanskamac's answer would do it for just the current (desired?) user. – Kevin K Dec 15 '09 at 0:20
our crond service had been stopped. This pointed us in right direction to check whether crond was running, and restart. – Paul 2 days ago

If you are using vi as editor, then just enter :%s/^/#/ in command mode. In all lines (%), it substitutes (s///) the begin of line (^) with a hash (#).

share|improve this answer
If you are not using vi as default editor, you can "force" usage of vi like EDITOR=vi; crontab -e, and than you can use the trick above. – Betlista Jan 25 '13 at 11:53
To uncomment, command is :%s/^#// – NP01 Aug 14 '13 at 3:18

In my limited testing, setting the shell to /bin/false works. You will still see /opt/ executing in your logs, but it will be a noop:


*/1 * * * *    root  /some/
share|improve this answer

Wasn't happy with the options above since they weren't one liners.

To disable crontab -l | perl -nle 's/^([^#])/# $1/;print' | crontab

To enable crontab -l | perl -nle 's/^#\s*([0-9*])/$1/;print' | crontab

usage example ( edited to show it doesn't disable comments)

$ crontab -l
# Comment
0 0 * * 0 /opt/

$ crontab -l|perl -nle 's/^([^#])/# $1/;print'|crontab
$ crontab -l
# Comment
# 0 0 * * 0 /opt/

$ crontab -l|perl -nle 's/^#\s*([0-9*])/$1/;print'|crontab
$ crontab -l
# Comment
0 0 * * 0 /opt/

Tested this on RHEL and AIX , and should work out of the box without anything needed to be installed

share|improve this answer

In any flavor of Unix/Linux that I know of:

mv /var/spool/cron  /var/spool/cron_is_disabled


  • disables crontabs of all users
  • but not system /etc/crontab (/etc/cron.daily. etc.)
  • persists across a reboot
  • is a one-liner, duh :)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.