Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.sbin / cron / doc / FEATURES
1 $FreeBSD: src/usr.sbin/cron/doc/FEATURES,v 1.4 1999/08/28 01:15:53 peter Exp $
2 $DragonFly: src/usr.sbin/cron/doc/FEATURES,v 1.2 2003/06/17 04:29:53 dillon Exp $
3
4 Features of Vixie's cron relative to BSD 4.[23] and SysV crons:
5
6 --      Environment variables can be set in each crontab.  SHELL, USER,
7         LOGNAME, and HOME are set from the user's passwd entry; all except
8         USER can be changed in the crontab.  PATH is especially useful to
9         set there.  TZ can be set, but cron ignores it other than passing
10         it on through to the commands it runs.  Format is
11
12                 variable=value
13
14         Blanks surrounding the '=' will be eaten; other blanks in value are
15         okay.  Leading or trailing blanks can be preserved by quoting, single
16         or double quotes are okay, just so they match.
17
18                 PATH=.:/bin:/usr/bin
19                 SHELL=/bin/sh
20                 FOOBAR = this is a long blanky example
21
22         Above, FOOBAR would get "this is a long blanky example" as its value.
23
24         SHELL and HOME will be used when it's time to run a command; if
25         you don't set them, HOME defaults to your /etc/passwd entry
26         and SHELL defaults to /bin/sh.
27
28         MAILTO, if set to the login name of a user on your system, will be the
29         person that cron mails the output of commands in that crontab.  This is
30         useful if you decide on BINMAIL when configuring cron.h, since binmail
31         doesn't know anything about aliasing.
32
33 --      Weekdays can be specified by name.  Case is not significant, but only
34         the first three letters should be specified.
35
36 --      Months can likewise be specified by name.  Three letters only.
37
38 --      Ranges and lists can be mixed.  Standard crons won't allow '1,3-5'.
39
40 --      Ranges can specify 'step' values.  '10-16/2' is like '10,12,14,16'.
41
42 --      Sunday is both day 0 and day 7 -- apparently BSD and ATT disagree
43         about this.
44
45 --      Each user gets their own crontab file.  This is a win over BSD 4.2,
46         where only root has one, and over BSD 4.3, where they made the crontab
47         format incompatible and although the commands can be run by non-root
48         uid's, root is still the only one who can edit the crontab file.  This
49         feature mimics the SysV cron.
50
51 --      The 'crontab' command is loosely compatible with SysV, but has more
52         options which just generally make more sense.  Running crontab with
53         no arguments will print a cute little summary of the command syntax.
54
55 --      Comments and blank lines are allowed in the crontab file.  Comments
56         must be on a line by themselves; leading whitespace is ignored, and
57         a '#' introduces the comment.
58
59 --      (big win) If the `crontab' command changes anything in any crontab,
60         the 'cron' daemon will reload all the tables before running the
61         next iteration.  In some crons, you have to kill and restart the
62         daemon whenever you change a crontab.  In other crons, the crontab
63         file is reread and reparsed every minute even if it didn't change.
64
65 --      In order to support the automatic reload, the crontab files are not
66         readable or writable except by 'crontab' or 'cron'.  This is not a
67         problem, since 'crontab' will let you do pretty much whatever you
68         want to your own crontab, or if you are root, to anybody's crontab.
69
70 --      If any output is generated by a command (on stdout OR stderr), it will
71         be mailed to the owner of the crontab that contained the command (or
72         MAILTO, see discussion of environment variables, above).  The headers
73         of the mail message will include the command that was run, and a
74         complete list of the environment that was passed to it, which will
75         contain (at least) the USER (LOGNAME on SysV), HOME, and SHELL.
76
77 --      the dom/dow situation is odd.  '* * 1,15 * Sun' will run on the
78         first and fifteenth AND every Sunday;  '* * * * Sun' will run *only*
79         on Sundays;  '* * 1,15 * *' will run *only* the 1st and 15th.  this
80         is why we keep 'e->dow_star' and 'e->dom_star'.  I didn't think up
81         this behaviour; it's how cron has always worked but the documentation
82         hasn't been very clear.  I have been told that some AT&T crons do not
83         act this way and do the more reasonable thing, which is (IMHO) to "or"
84         the various field-matches together.  In that sense this cron may not
85         be completely similar to some AT&T crons.