cron(1M)
NAME
cron − clock daemon
SYNOPSIS
/etc/cron
DESCRIPTION
cron executes commands at specified dates and times. Regularly scheduled commands can be specified according to instructions found in crontab files. Users can also submit their own crontab file via the crontab(1) command. Commands that are to be executed only once can be submitted by using the at command. Since cron never exits, it should be executed only once. This is best done by running cron from the initialization process through the file /etc/rc (see init(1M)).
cron only examines crontab files and at(1) command files during process initialization and when a file changes. This reduces the overhead of checking for new or changed files at regularly scheduled intervals.
In the HP Clustered environment, the directories /usr/lib/cron and /usr/spool/cron are context dependent files (CDFs). Each cnode is expected to run its own copy of cron.
Notes
On the days of daylight savings (summer) time transition (in time zones and countries where daylight savings time applies), cron schedules commands differently than normal.
In the following description, an ambiguous time refers to an hour and minute that occurs twice in the same day because of a daylight savings time transition (usually on a day during the Autumn season). A non-existent time refers to an hour and minute that does not occur because of a daylight savings time transition (usually on a day during the Spring season). DST-shift refers to the offset that is applied to standard time to result in daylight savings time. This is normally one hour, but can be any combination of hours and minutes up to 23 hours and 59 minutes (see tztab(4)).
When a command is specified to run at an ambiguous time, the command is executed only once at the first occurrence of the ambiguous time.
When a command is specified to run a non-existent time, the command is executed after the specified time by an amount of time equal to the 1DST-shift. When such an adjustment would conflict with another time specified to run the command, the command is run only once rather than running the command twice at the same time.
For commands that are scheduled to run during all hours by specifying a ∗ in the hour field of the crontab entry, the command is scheduled without any adjustment.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, cron behaves as if all internationalization variables are set to "C". See environ(5).
EXAMPLES
The following examples assume that the time zone is MST7MDT. In this time zone the DST transition occurs one second before 2:00 a.m. and the DST-shift is 1 hour.
Consider the following crontab entries:
| # Minute | Hour | Month Day | Month | Weekday | Command |
| 0 | 01 | * | * | * | Job_1 |
| 0 | 02 | * | * | * | Job_2 |
| 0 | 03 | * | * | * | Job_3 |
| 0 | 04 | * | * | * | Job_4 |
| 0 | * | * | * | * | Job_hourly |
| 0 | 2,3,4 | * | * | * | Multiple_1 |
| 0 | 2,4 | * | * | * | Multiple_2 |
For the period of 01:00 a.m. to 04:00 a.m. on the days of DST transition, the results will be:
| Job | Times Run in Fall | Times Run in Spring |
| Job_1 | 01:00 MDT | 01:00 MST |
| Job_2 | 02:00 MDT | 03:00 MDT |
| Job_3 | 03:00 MST | 03:00 MDT |
| Job_4 | 04:00 MST | 04:00 MDT |
| Job_hourly | 01:00 MDT | 01:00 MST |
| 02:00 MDT | ||
| 02:00 MST | ||
| 03:00 MST | 03:00 MDT | |
| 04:00 MST | 04:00 MDT | |
| Multiple_1 | 02:00 MDT | |
| 03:00 MST | 03:00 MDT | |
| 04:00 MST | 04:00 MDT | |
| Multiple_2 | 02:00 MDT | 03:00 MDT |
| 04:00 MST | 04:00 MDT |
WARNINGS
In the Spring, when there is a non-existent hour because of daylight savings time, a command that is scheduled to run multiple times during the non-existent hour will only be run once. For example, a command scheduled to run at 2:00 and 2:30 a.m. in the MST7MDT time zone will only run at 3:00 a.m. The command that was scheduled at 2:30 a.m. will not be run at all, instead of running at 3:30 a.m.
DIAGNOSTICS
A history of all actions taken by cron is recorded in /usr/lib/cron/log.
AUTHOR
cron was developed by AT&T and HP.
FILES
/usr/lib/cron main cron directory
/usr/spool/cron spool area
/usr/lib/cron/log accounting information
SEE ALSO
at(1), crontab(1), sh(1), init(1M), cdf(4), queuedefs(4), tztab(4).
STANDARDS CONFORMANCE
cron: SVID2
Hewlett-Packard Company — HP-UX Release 8.05: June 1991