Add job to the cron...
 

Add job to the crontab  


admin
Posts: 93
Admin
(@mjv119gmail-com)
Member
Joined: 5 years ago

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.

2 Replies
Alan
Posts: 35
 Alan
(@alan)
Eminent Member
Joined: 3 months ago

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.

Reply
Gnana
Posts: 25
(@gnana)
Eminent Member
Joined: 3 months ago

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://www.spytm.com/questions/topic/how-to-load-crontab-from-a-file/

Reply

Leave a reply


 
Preview 0 Revisions Saved
Share: