[Tux Gif]
 Linux System Administration

CUPS and CRON


/etc/crontab
            [mlevan@localhost ~]$ more /etc/crontab
            SHELL=/bin/bash
            PATH=/sbin:/bin:/usr/sbin:/usr/bin
            MAILTO=root
            HOME=/

            # run-parts
            01 * * * * root run-parts /etc/cron.hourly
            02 4 * * * root run-parts /etc/cron.daily
            22 4 * * 0 root run-parts /etc/cron.weekly
            42 4 1 * * root run-parts /etc/cron.monthly



Here
Now for the more complicated second part of a crontab file. An entry in cron is made up of a series of fields, much like the /etc/passwd file is, but in the crontab they are separated by a space. There are normally seven fields in one entry. The fields are:
minute   hour   dom   month   dow   cmd

minute: This controls what minute of the hour the command will run on, and is between '0' and '59'

hour:
This controls what hour the command will run on, and is specified in the 24 hour clock, values must be between 0 and 23 (0 is midnight)

dom
: This is the Day of Month, that you want the command run on, e.g. to run a command on the 19th of each month, the dom would be 19.

month:
This is the month a specified command will run on, it may be specified numerically (0-12), or as the name of the month (e.g. May)

dow
: This is the Day of Week that you want a command to be run on, it can also be numeric (0-7) or as the name of the day (e.g. sun).

cmd
: This is the command that you want run. This field may contain multiple words or spaces.

Prev                Page 4                Next