Delete a Cron Job


To totally unlock this section you need to Log-in


Login

Follow the steps below to delete or deactivate a Cron Job (scheduled task) that you have previously created.

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, we can always use even an SSH access, if vonfigured on the system.

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.

Delete a Cron Job

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 pound sign(#) so that the line is commented, press the i key to insert text and then add the pound sign to the very beginning of the line.

Delete a Cron Job

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 type dd by pressing the 'd' key twice. This should remove the entire line.

Delete a Cron Job

To save your changes, press the Esc key and then type :x and press ENTER to exit and save changes.

Delete a Cron Job

The Crontab should update.

Delete a Cron Job

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.

Delete a Cron Job

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.

Delete a Cron Job

Next, type crontab -l to list the crontab and verify that all Cron Jobs have been removed.

Delete a Cron Job