[9] | 1 | .TH CRON 8
|
---|
| 2 | .SH NAME
|
---|
| 3 | cron \- clock daemon
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | .B cron
|
---|
| 6 | .RB [ \-d\c
|
---|
| 7 | .RI [ level ]]
|
---|
| 8 | .SH DESCRIPTION
|
---|
| 9 | The
|
---|
| 10 | .B cron
|
---|
| 11 | daemon executes tasks that must be repeated every now and then (cron jobs),
|
---|
| 12 | and tasks that must be run just once (at jobs). It is normally used to run
|
---|
| 13 | daily or weekly system maintenance scripts. What it needs to run and when
|
---|
| 14 | is specified in a number of "cron tables", or crontab files for short.
|
---|
| 15 | These tables are:
|
---|
| 16 | .PP
|
---|
| 17 | .RS
|
---|
| 18 | .nf
|
---|
| 19 | .ft B
|
---|
| 20 | /usr/lib/crontab
|
---|
| 21 | /usr/local/lib/crontab
|
---|
| 22 | /var/lib/crontab
|
---|
| 23 | /var/opt/\fIname\fP/lib/crontab\ \ \fR(Minix-vmd only)\fB
|
---|
| 24 | /usr/spool/crontabs/\fIuser\fP
|
---|
| 25 | .ft R
|
---|
| 26 | .fi
|
---|
| 27 | .RE
|
---|
| 28 | .PP
|
---|
| 29 | These files follow the usual pattern: One for the standard things, one for
|
---|
| 30 | local tasks per organization, one for tasks per system, and one crontab per
|
---|
| 31 | installed package. (Cron reads
|
---|
| 32 | .B /usr/lib/packages
|
---|
| 33 | to find names of installed packages, it doesn't just grab everything in
|
---|
| 34 | .BR /var/opt .)
|
---|
| 35 | The last set of files fall outside the normal pattern, they are per user
|
---|
| 36 | crontabs that one can create with the
|
---|
| 37 | .BR crontab (1)
|
---|
| 38 | command. The file names in
|
---|
| 39 | .B /usr/spool/crontabs/
|
---|
| 40 | are login names of the file owners.
|
---|
| 41 | .PP
|
---|
| 42 | The format of a crontab file is described in
|
---|
| 43 | .BR crontab (5).
|
---|
| 44 | .SS "AT jobs"
|
---|
| 45 | .B Cron
|
---|
| 46 | also takes care of the execution of jobs issued by
|
---|
| 47 | .BR at (1)
|
---|
| 48 | that are found in
|
---|
| 49 | .BR /usr/spool/at/ .
|
---|
| 50 | Cron simply runs the AT job as if there were an "sh at-job" as a cron job at
|
---|
| 51 | the appropriate time under the user-id of the owner of the script. The
|
---|
| 52 | script takes care of the rest. See
|
---|
| 53 | .BR at (1)
|
---|
| 54 | for the details.
|
---|
| 55 | .SS "Job I/O"
|
---|
| 56 | Standard input, output and error are the same as cron's if the job is
|
---|
| 57 | started by the system crontabs or from package crontabs. This means that
|
---|
| 58 | output from system jobs usually ends up on the console and in the log file.
|
---|
| 59 | Output from personal cron jobs or at jobs are mailed to the owner of the
|
---|
| 60 | job. No mail is sent if the job is silent.
|
---|
| 61 | .SH OPTIONS
|
---|
| 62 | .TP 5
|
---|
| 63 | [\fB\-d\fR[\fIlevel\fR]]
|
---|
| 64 | Set the debug level, by default 1. Makes
|
---|
| 65 | .B cron
|
---|
| 66 | print info on what it happens to be doing. Level 1 just tells about sleep
|
---|
| 67 | times and what job is executed, level 2 also shows the internal crontab
|
---|
| 68 | data on a table load. (With time fields translated to match those of
|
---|
| 69 | .BR "struct tm" ,
|
---|
| 70 | see
|
---|
| 71 | .BR ctime (3).)
|
---|
| 72 | .SS SIGNALS
|
---|
| 73 | .B Cron
|
---|
| 74 | takes the following actions when sent one of the following signals:
|
---|
| 75 | .TP 12
|
---|
| 76 | .B SIGHUP
|
---|
| 77 | Reload the crontab tables if they changed since the last time they were
|
---|
| 78 | loaded, and reexamine the AT job spool. Used by
|
---|
| 79 | .BR at (1)
|
---|
| 80 | and
|
---|
| 81 | .BR crontab (1).
|
---|
| 82 | .TP
|
---|
| 83 | .B SIGUSR1
|
---|
| 84 | Increase the debug level by 1.
|
---|
| 85 | .TP
|
---|
| 86 | .B SIGUSR2
|
---|
| 87 | Turn debugging off.
|
---|
| 88 | .SH ENVIRONMENT
|
---|
| 89 | .B Cron
|
---|
| 90 | sets the environment variables
|
---|
| 91 | .BR USER ,
|
---|
| 92 | .BR LOGNAME ,
|
---|
| 93 | .BR HOME ,
|
---|
| 94 | and
|
---|
| 95 | .BR SHELL
|
---|
| 96 | to the user's login name (2x), home directory, and shell if a job is
|
---|
| 97 | executed for a given user. The working directory is set to the user's home
|
---|
| 98 | directory. Everything else is inherited from
|
---|
| 99 | .BR cron ,
|
---|
| 100 | exactly as
|
---|
| 101 | .B cron
|
---|
| 102 | got it when it started. Note that commands are always passed to
|
---|
| 103 | .BR /bin/sh ,
|
---|
| 104 | not to the user's shell.
|
---|
| 105 | .PP
|
---|
| 106 | System cron jobs are in principle executed with
|
---|
| 107 | .BR cron 's
|
---|
| 108 | environment, use
|
---|
| 109 | .B "\-u root"
|
---|
| 110 | or the crontab file
|
---|
| 111 | .B /usr/spool/crontabs/root
|
---|
| 112 | if you want to give root the same treatment as ordinary users.
|
---|
| 113 | .SH FILES
|
---|
| 114 | .TP 25n
|
---|
| 115 | .B /usr/lib/crontab
|
---|
| 116 | Main MINIX 3 crontab file.
|
---|
| 117 | .TP
|
---|
| 118 | .B /usr/local/lib/crontab
|
---|
| 119 | Local jobs for all systems in an organization.
|
---|
| 120 | .TP
|
---|
| 121 | .B /var/lib/crontab
|
---|
| 122 | System specific jobs.
|
---|
| 123 | .TP
|
---|
| 124 | .B /var/opt/\fIname\fP/lib/crontab
|
---|
| 125 | Per package jobs for Minix-vmd.
|
---|
| 126 | .TP
|
---|
| 127 | .B /usr/lib/packages
|
---|
| 128 | List of installed packages.
|
---|
| 129 | .TP
|
---|
| 130 | .B /usr/spool/crontabs/\fIuser\fP
|
---|
| 131 | Per user jobs.
|
---|
| 132 | .TP
|
---|
| 133 | .B /usr/spool/at/*
|
---|
| 134 | Jobs issued by
|
---|
| 135 | .BR at (1).
|
---|
| 136 | .TP
|
---|
| 137 | .B /usr/run/cron.pid
|
---|
| 138 | Process id of cron when cron is running. Used by
|
---|
| 139 | .BR at (1)
|
---|
| 140 | and
|
---|
| 141 | .BR crontab (1)
|
---|
| 142 | to send cron a hangup signal.
|
---|
| 143 | .SH "SEE ALSO"
|
---|
| 144 | .BR at (1),
|
---|
| 145 | .BR crontab (1).
|
---|
| 146 | .SH NOTES
|
---|
| 147 | A job is not reissued until a previous instance of it has exited. The next
|
---|
| 148 | time to execute is computed from the previous time it ran. If job issuing
|
---|
| 149 | lags behind on the system time then the next time to run it is computed from
|
---|
| 150 | the current system time.
|
---|
| 151 | .SH BUGS
|
---|
| 152 | .B Cron
|
---|
| 153 | doesn't like it if the system time is changed. If set forward then cron
|
---|
| 154 | will react when it next wakes up by running all jobs within the skipped time
|
---|
| 155 | once or twice before it catches up. Setting the clock backwards makes cron
|
---|
| 156 | play dead until the system time passes the old time. (Changing the system
|
---|
| 157 | time is bad idea anyway, and not just because of cron.)
|
---|
| 158 | .PP
|
---|
| 159 | Jobs that fall in the missing hour in a change to Daylight Saving Time are
|
---|
| 160 | skipped. Nothing is done in the extra hour on the change out of DST.
|
---|
| 161 | .SH AUTHOR
|
---|
| 162 | Kees J. Bot (kjb@cs.vu.nl)
|
---|
| 163 |
|
---|
| 164 | .\"
|
---|
| 165 | .\" $PchId: cron.8,v 1.3 2000/07/17 18:49:18 philip Exp $
|
---|