help me to schedule-cron job [message #98486] |
Wed, 24 November 2004 03:33 |
satya das
Messages: 6 Registered: July 2004
|
Junior Member |
|
|
Hi All,
can anyone help me how to schedule a task.
i mean i dont know anything about it.
guide me how to use cron and crontab and where?
what all i need to check and do for the same
Thanks & Regards
satya
|
|
|
Re: help me to schedule-cron job [message #98490 is a reply to message #98486] |
Wed, 24 November 2004 07:46 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
For help: man crontab
Commonly used commands:
crontab -l (list cron contents for your ID)
crontab -e (edit your crontab contents)
crontab -l > my_cronfile.txt (output to a file)
crontab my_cronfile.txt (to "submit" jobs to cron)
You need to set any environment variables your script will need in the script.
|
|
|
Re: help me to schedule-cron job [message #98521 is a reply to message #98486] |
Mon, 13 December 2004 22:53 |
Ayyapa Raju
Messages: 1 Registered: December 2004
|
Junior Member |
|
|
Examples how to set cron:
If you have installed a cgi script in your cgi-bin directory called members.cgi and wanted to run this program each night as 11.30 PM as in above example.
You would setup the following crontab line:
30 23 * * * /home/username/www/cgi-bin/members.cgi
30--represents the minute of cron work
23--represents the hour of the day
The * represent every day, month, and weekday.
If you want to set the cron job every sunday at midnight 11.30 PM then it would be like:
30 23 * * 0 /home/username/www/cgi-bin/members.cgi
0--represents the Sunday.
If you want the cron job to run at 1:00 and 2:00 A.M then you can set it like:
* 1,2 * * * /home/username/www/cgi-bin/members.cgi
This runs your cron at 1 and 2 A.M every day, every month and every week.
If you want to run the above task only from Monday to Friday then set it like:
* 1,2 * * 1-5 /home/username/www/cgi-bin/members.cgi
|
|
|