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
No comments:
Post a Comment