You are Here: FAQScripting & ProgrammingCron JobsArticle #4
How can I remove/delete a Cron Job?
Linux Packages with SSH Access Only!
There are really three options when removing Cron Jobs. The first is that the entire Crontab can be deleted will will erase all Cron Jobs. The second is that the Crontab can be edited to remove the line that contains the Cron Job. The third option is editing the Crontab to comment out the line that contains the Cron Job, leaving the Cron Job there for use later if necessary.
Regardless of the option chosen, SSH access is required. Please log into your webspace via SSH. For more help, please reference How do I connect to my webspace via SSH? or How do I connect to my webspace via SSH on a Mac?
Deleting or disabling a specific Cron Job
To delete or comment out a Cron Job from the Crontab, simply type crontab -e to edit the Crontab. To exit the Crontab at any time (in case a mistake is made) simply press the Esc key and then type :q! and press ENTER to quit without(!) saving.
Once the Crontab has been opened using the VI editor, use your arrow keys to place the cursor at the beginning of the Cron Job line that is to be deleted or commented out. To insert the hash symbol(#) so that the line is commented, press the i key to insert text and then add the hash symbol to the very beginning of the line.
Or to delete a Cron Job from the Crontab altogether, make sure that the cursor is at the very beginning of the Cron Job line that is to be removed and press the 'd' key twice ('dd'). This should remove the entire line.
To save your changes, press the Esc key and then type :x and press ENTER to exit and save changes.
The Crontab should update.
Next, check the Crontab by typing crontab -l and pressing ENTER to list the Crontab. The line(s) removed should no longer be listed in the Crontab.
Deleting all Cron Jobs within the Crontab
To delete the entire Crontab simply type crontab -r and press ENTER to remove or delete the entire Crontab.
Next, type crontab -l to list the crontab and verify that all Cron Jobs have been removed.
© 2012 1&1 Internet Ltd