Sun Microsystems Sun Workstation 100U System Manager's Manual page 175

Table of Contents

Advertisement

CRON(8)
MAINTENANCE COMMANDS
CRON(8)
NAME
cron - clock daemon
SYNOPSIS
/ete/eroB
DESCRIPTION
FILES
Cron executes commands at specified dates and times according to the instructions in the file
/usr/lib/crontab. Since cron never exits, it should only be executed once. This is best done by
running cron from the initialization process through the file / etc/ rc; see init(8).
/usr/lib/crontab consists of lines of six fields each. The fields are separated by spaces or tabs.
The first five are integer patterns to specify the minute (0-59), hour (0-23), day of the month (1-
31), month of the year (1-12), and day of the week (1-7 with I=Monday). Each of these patterns
may contain a number in the range above; two numbers separated by a dash meaning a range
inclusive; a list of numbers separated by commas meaning any of the numbers; or an asterisk
meaning all legal values. The sixth field is a string that is executed by the shell at the specified
times. 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.
Here are a few example lines from / usr/lib/ crontab, to give you a better sense of the file's format:
o
0 • • •
calendar -
150· • • /usr/etc/sa
-8
>
/dev /null
0,30· • • • /usr/etc/dmesg - »/usr/aAim/messages
15 4 • • • find /usr/preserve -mtime
+
7 -a -exec rm -f {} ;
104 • • • egrep 'SYSERRlrefusedlunreachable' /usr/spool/log/syslog.O Imail Postmaster
Cron examines / usr/lib/ crontab under the following conditions:
At least once per hour (on the hour).
When the next command is to be run -
cron looks ahead until the next command and sleeps
until then.
When cron's process is sent a
SlGIRJP.
This means that comeone who changes/usr/lib/ crontab
can get cron to look at it right away.
You can also create the / usr/ adm/ cronlog file, if you wish.
If
the file exists, cron logs to it each
time it executes an instruction from / usr/lib/ crontab. You can thus use the cronlog file
to
make
sure cron is running properly. The lines in the file consist of a timestamp, and process statement.
Lines look something like this:
Thu Mar 8 10:20:00 1984: /etc/dmesg - > > /usr/adm/messages
Thu Mar
8
10:2Q:59 1984: /etc/atrun
Thu Mar 8 10:30:00 1984: /etc/dmesg - > >/usr/adm/messages
Thu Mar 8 10:39:59 1984: /etc/dmesg - > > /usr/adm/messages
/usr/lib/crontab
/ usr /3I.lm/ cronlog
Instruction file
Log file
SEE ALSO
crontab(5)
20
Last change: 8 March 1984
Sun Release 1.1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun workstation 150u

Table of Contents