2 Forked yacron from dcron
4 * Applied "Daniel's patch" to enable logging to syslog (-S) or to
5 file (-L file). Added further logging improvements. -l switch i
6 accepts symbolic log levels, as described in syslog.3 and logger.1.
7 Syslogs are sent using identity LOG_IDENT (defaults to "crond") and
8 facility LOG_CRON. The date etc. formatting of file-based logs is
9 defined in LOG_DATE_FMT.
11 * When crond is run in the foreground, all log messages are sent to stderr
12 instead of syslog or the declared -L file.
14 * Added -M mailscript and -m mailto switches. If a mailscript
15 is supplied, it is called with no arguments and with a mail header,
16 followed by the stdout and stderr of the cronjob, as stdin. When no
17 mailscript is supplied, attempts to mail cron output are logged.
18 When cronjobs have no stdout or stderr, nothing is sent to either
19 sendmail or a custom mailscript.
21 * Log when a cronjob exits with a code that's neither 0 nor EAGAIN
22 (regardless of whether any cron output is generated). Any jobs
23 waiting on the failed job are also cancelled (see below).
25 * Use getopt in main.c and crontab.c.
27 * crontab uses $EDITOR before $VISUAL.
29 * TMPDIR specifies where to save crontabs-being-edited and output files
30 from running jobs. Latter are saved in a secure subdirectory.
32 * '* * 2,5 * Mon' in crontab = "2nd and last Mon of the month", instead
33 of "2nd and 5th day of the month, or any Mon." Last Mondays, etc. of
34 the month are always recognized as "5th" Mondays, even if there are
35 only 4 Mondays in the month. (They're also then recognized as "4th"
36 Mondays, too; but if you say '* * 4,5 * Mon' the job will only be
39 * Accept @reboot, @daily, etc. options in crontabs. @daily jobs
40 will be run whenever at least a day has passed since they were last
41 run (the machine need not be awake at any specific time).
42 These jobs require an ID=<job_name> at the start of their
43 command column, to supply a name for the timestamp file. The formatting
44 of the timestamp files is defined in TIMESTAMP_FMT.
46 * Also accept FREQ=2d/1h assignments: this will try to run a command
47 once every two days, but only during the range of time specified in
48 the crontab line's first five columns. If the command exits with status
49 EAGAIN (exit code 11) it will be retried again every 1 hour (until
50 it exits with a different code). These jobs also require an
51 ID=<job_name> assignment.
53 * Also accept AFTER=<target_job>/1d assignments: if the specified
54 target_job is scheduled to run within the next 1 day, wait until
55 it has run and exited successfully before running the current command.
56 If target_job exits with a code that's neither 0 nor EAGAIN, the
57 waiting job is cancelled.
59 * When scheduling a job that waits on a target_job that's declared
60 using @reboot or @noauto---and so which would never again be regularly
61 scheduled---crond also schedules the target_job.
63 * When crond sees a cron.update file (generated by crontab to announce
64 an updated crontab file), it re-reads timestamp files. Also, lines of the
65 form 'user job1 !job2' in cron.update will schedule the named jobs.
66 Here 'job2' will be scheduled to run immediately, without waiting for any
70 Fixed a minor bug, remove the newline terminating a line only if there
71 is a newline to remove.
74 Add support for root-run crontab files in /etc/cron.d and rewrite a
75 good chunk of the crontab file management code. By VMiklos and Matt
79 Fix /tmp race and misc cleanups from Emiel Kollof <emiel@gamepoint.net>
82 Modernize the code, remove strcpy() and sprintf() in favor of snprintf().
83 (Supplied by Christine Jamison <technobabe@mail.nwmagic.net>)
86 Fixed bug found by Christian HOFFMANN. newline removal was broken
87 for lines that began with whitespace, causing crontab lines to be
91 Committed changes suggested by
92 Ragnar Hojland Espinosa <ragnar@redestb.es>
94 Fixed a few printfs, removed strdup() function ( strdup() is now standard
102 dillon: Fixed bug in job.c -- if ChangeUser() fails, would return from child fork rather
106 dillon: Initial release