[Tux Gif]
 Linux System Administration

CUPS and CRON


/etc/crontab


Cron also accepts lists in the fields. Lists can be in the form, 1,2,3 (meaning 1 and 2 and 3) or 1-3 (also meaning 1 and 2 and 3).

Example:

59  11  *  *  1,2,3,4,5   backup.sh

Will run backup.sh at 11:59 Monday, Tuesday, Wednesday, Thursday and Friday, as will:

59  11  *  *  1-5   backup.sh


Cron also supports 'step' values.
A value of */2 in the dom field would mean the command runs every two days and likewise, */5 in the hours field would mean the command runs every 5 hours.

Example:

*  12  10-16/2  *  *  backup.sh

is the same as:

* 12 10,12,14,16 * *  backup.sh


*/15 9-17 * * *  connection.test

Will run connection.test every 15 mins between the hours or 9am and 5pm

Prev                Page 7                Next