how to schedule a job in crontab, in HP unix [message #58597] |
Sat, 20 September 2003 17:07 |
Kapil
Messages: 145 Registered: May 2002
|
Senior Member |
|
|
I am using hp Unix, i need to schedule aa.ksh,bb.ksh in crontab, and i am new to unix, how should i use this crontab, all i know is, crontab is used to schedule job, can any one give me an eg to use this crontab.
|
|
|
Re: how to schedule a job in crontab, in HP unix [message #58604 is a reply to message #58597] |
Sun, 21 September 2003 08:00 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
Kapil,
all you need to do is create a text file with 6 fields, indicating the time and frequency of the commands to be executed,the actual command and any error redirection.
eg)
30 5 * * 1,6 cd /home/kapil/aa.ksh > /home/kapil/aa.log
where field1 is minute (0-59),
field2 is hour (0-23),
field3 is day of the month (1-31),
field4 is month of the year (1-12),
field5 is day of the week (0-6 with 0=Sunday)
field6 is 'your script'
Here we are scheduling aa.ksh script to run 5:30AM every Monday & Saturday of every month of the year.
Once this file is ready , do
crontab 'crontab text file you created'
and do a
crontab -l
to show the contents of your cronjob.
Hope this helps
Thiru
|
|
|