How to disable everything in crontab -l?

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


Solution 1:

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

Solution 2:

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

Solution 3:

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

Solution 4:

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 (#).