Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cron(8)

rc(8)

CRONTAB(5)  —  FILE FORMATS

NAME

crontab − table of times to run periodic jobs

SYNOPSIS

/usr/lib/crontab

DESCRIPTION

The /etc/cron utility is a permanent process, started by /etc/rc.local, that wakes up once every minute. /etc/cron consults the file /usr/lib/crontab to find out what tasks are to be done, and at what time. 

Each line in /usr/lib/crontab consists of six fields, separated by spaces or tabs, as follows:

1.minutes field, which can have values in the range 0 through 59. 

2.hours field, which can have values in the range 0 through 23. 

3.day of the month, in the range 1 through 31. 

4.month of the year, in the range 1 through 12. 

5.day of the week, in the range 1 through 7.  Monday is day 1 in this scheme of things. 

6.(the remainder of the line ) is the command to be run.  A percent character in this field is translated to a new-line character.  Only the first line (up to a % or end of line) of the command field is executed by the Shell.  The other lines are made available to the command as standard input. 

Any of fields 1 through 5 can be a list of values separated by commas.  A field can be a pair of numbers separated by a hyphen, indicating that the job is to be done for all the times in the specified range.  If a field is an asterisk character (∗) it means that the job is done for all possible values of the field. 

FILES

/usr/lib/crontab

SEE ALSO

cron(8), rc(8)

EXAMPLE

0 0 ∗ ∗ ∗ calendar -
15 0 ∗ ∗ ∗ /etc/sa -s >/dev/null
15 4 ∗ ∗ ∗ find /usr/preserve -mtime +7 -a -exec rm -f {} ;
40 4 ∗ ∗ ∗ find / -name ’#∗’ -atime +3 -exec rm -f {} ;
0,15,30,45 ∗ ∗ ∗ ∗ /etc/atrun
0,10,20,30,40,50 ∗ ∗ ∗ ∗ /etc/dmesg - >>/usr/adm/messages
5 4 ∗ ∗ ∗ sh /etc/newsyslog

The calendar command run at minute 0 of hour 0 (midnight) of every day.  The /etc/sa command runs at 15 minutes after midnight every day.  The two find commands run at 15 minutes past four and at 40 minutes past four, respectively, every day of the year.  The atrun command (which processes shell scripts users have set up with at) runs every 15 minutes.  The /etc/dmesg command appends kernel messages to the /usr/adm/messages file every ten minutes, and finally, the /usr/adm/syslog script runs at five minutes after four every day. 

Sun Release 3.2  —  Last change: 6 November 1984

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026