DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

Crontab - How to Edit

By: Shailesh Singh | 16 Oct 2008 12:05 pm

How to Edit Entry in Crontab file

The crontab (cron derives from chronos, Greek for time; tab stands for table)

To Open crontab file 

$ crontab -l

To edit it 

$ crontab -e

this will open the crontab file in VI Editor

Format of Crontab

* * * * * /bin/execute/folder/script.sh

As you can see there are 5 stars. The stars represent different date parts in the following order:

  1. minute (from 0 to 59)
  2. hour (from 0 to 23)
  3. day of month (from 1 to 31)
  4. month (from 1 to 12)
  5. day of week (from 0 to 6) (0=Sunday)

To run the command every minut

* * * * * /bin/execute/this/script.sh  in this way u can edit the crontab file to automate your script  

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move