[plug] Cron scheduling

Steve Grasso steveg at calm.wa.gov.au
Wed Oct 13 12:51:41 WST 1999


Paul,

>I'm wanting to schedule jobs and I know the tool to use is Cron.  My problem
>is I have looked through all the Howtos and mini-howtos and can not find one
>for Cron.  I scanned through the man pages for Cron and Crontab but they
>don't explain very well how to create a scheduled job.  Can anyone point me
>to some useful documentation?

I wrote this nano-mini-HOWTO a while ago to remind myself. Never published
it tho:

CRONTAB (Vixie CRON)
==========================================================

eg. Need to set up a CRONTAB entry to run prog.cgi every 15 days.

A CRONTAB entry of:

0 0 1,15 * * /your/path/to/prog.cgi 

runs the script at midnight on day 1 and 15 of every month for any day of
the week.

Note on setting a CRONTAB entry
---------------------------------------------------------------------------

1. crontab -r deletes any existing CRONTAB file for a user
2. crontab -e edits an existing CRONTAB file for a user
3. CRONTAB opens in the default text editor.
4. The CRONTAB file may have many entries, one entry per line only with no
blank lines. A CRONTAB entry of the following format:

A B C D E F

where

A = minute 0-59
B = hour 0-23
C = day of month 1-31
D = month of yr 1-12
E = day of week 0-6 Sun-Sat
F = the shell command to be run

Valid entries are:

- an integer
- two integers separated by a dash, representing an inclusive range
- a list of integers separated by a coma
- asterisk for all possible values

========================================================

Hope this helps,
Steve



More information about the plug mailing list