How to stop cron job?

QuestionsQuestions8 SkillsProYour First Linux LabAug, 30 2025
0362

To stop a cron job, you need to edit the crontab file where the job is scheduled. Here’s how to do it:

  1. Open the crontab file for editing:

    crontab -e
  2. Locate the cron job you want to stop. It will look something like this:

    * * * * * /path/to/your/script.sh
  3. Delete the line corresponding to the cron job you want to stop, or comment it out by adding a # at the beginning of the line:

    # * * * * * /path/to/your/script.sh
  4. Save and exit the editor. The method to save and exit depends on the text editor you are using (e.g., for nano, press Ctrl+O, Enter, then Ctrl+X).

  5. Verify the changes by listing the current cron jobs:

    crontab -l

This will confirm that the job has been successfully removed or commented out.

0 Comments

no data
Be the first to share your comment!