How to add job to the crontab?

Home Questions How to add job to the crontab?

Tagged: 

This topic contains 2 replies, has 3 voices, and was last updated by  Thushara Muralidharan 2 years, 2 months ago.

  • Author
    Posts
  • #6663 Reply

    admin
    Keymaster
    Offline
    Topics: 65
    Replies: 65

    I have some 26 scripts which has to run in specific intervals. I know using crontab i can schedule jobs but I am not aware of how to add this to the crontab.
    Please tell me to add an entry in the crontab file.

  • #6747 Reply

    admin
    Keymaster
    Offline
    Topics: 65
    Replies: 65

    crontab accepts entry only in a specific format as below:

    minute hour day month week command or script

    1. Open crontab in VI editor by below command:

    crontan -e

    2. In the editing mode (i), add all your 26 scripts as mentioned in the above format. One script per line.
    3. Save the changes: Esc key and :wq which will update the changes and quit from the VI editor.
    Now you have all your entries in the crontab.

    View your crontab jobs by below command:

    crontab -l

    Good Luck.

  • #6752 Reply

    Thushara Muralidharan
    Participant
    Offline
    Topics: 12
    Replies: 10

    Create a file and add all the entries in that file. Execute the below command to add the entries from the file to crontab.
    Even your crontab list is lost, you have the cronfile and you can add it to crontab at anytime.

    Read this to sync crontab and cronfile: http://spytm.com/questions/topic/how-to-load-crontab-from-a-file/

Reply To: How to add job to the crontab?

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Your information: