xref: /freebsd/usr.sbin/cron/doc/MAIL (revision 05248206f720394d95c2a7475429311df670a2e9)
184f33deaSJordan K. Hubbard[ this is really old mail that came to me in response to my 1986 posting
284f33deaSJordan K. Hubbard  to usenet asking for feature suggestions before releasing the first
384f33deaSJordan K. Hubbard  version of cron.  it is presented here for its entertainment value.
484f33deaSJordan K. Hubbard  --vix ]
584f33deaSJordan K. Hubbard
684f33deaSJordan K. HubbardFrom ptsfa!lll-crg!ames!acornrc!bob Wed Dec 31 10:07:08 1986
784f33deaSJordan K. HubbardDate: Wed, 31 Dec 86 08:59:31 pst
884f33deaSJordan K. HubbardFrom: lll-crg!ames!acornrc!bob (Bob Weissman)
984f33deaSJordan K. HubbardTo: ptsfa!vixie!paul
1084f33deaSJordan K. HubbardStatus: RO
1184f33deaSJordan K. Hubbard
1284f33deaSJordan K. HubbardSure, here's a suggestion: I'd like to be able to run a program, say,
1384f33deaSJordan K. Hubbardevery two hours.  Current cron requires me to write
1484f33deaSJordan K. Hubbard0,2,4,6,8,10,12,14,16,18,20,22 in the hours field.  How about a notation
1584f33deaSJordan K. Hubbardto handle this more elegantly?
1684f33deaSJordan K. Hubbard
1784f33deaSJordan K. Hubbard<<	Okay, I've allowed 0-22/2 as a means of handling this.
1884f33deaSJordan K. Hubbard	The time specification for my cron is as follows:
1984f33deaSJordan K. Hubbard		specification = range {"," range}
2084f33deaSJordan K. Hubbard		range = (start "-" finish ["/" step]) | single-unit
2184f33deaSJordan K. Hubbard	This allows "1,3,5-7", which the current cron doesn't (it won't
2284f33deaSJordan K. Hubbard	do a range inside a list), and handles your specific need.	>>
2384f33deaSJordan K. Hubbard
2484f33deaSJordan K. HubbardFrom drw@mit-eddie Wed Dec 31 18:25:27 1986
2584f33deaSJordan K. HubbardDate: Wed, 31 Dec 86 14:28:19 est
2684f33deaSJordan K. HubbardFrom: drw@mit-eddie (Dale Worley)
2784f33deaSJordan K. HubbardTo: mit-eddie!vixie!paul
2884f33deaSJordan K. HubbardStatus: RO
2984f33deaSJordan K. Hubbard
3084f33deaSJordan K. HubbardWe have a lot of lines in our crontab of the form
3184f33deaSJordan K. Hubbard
3284f33deaSJordan K. Hubbard	00 12 * * * su user < /usr/users/user/script.file
3384f33deaSJordan K. Hubbard
3484f33deaSJordan K. HubbardThis barfs (silently!) on our system (Dec Ultrix 1.2 == 4.2bsd) if
3584f33deaSJordan K. Hubbarduser's shell is csh.  This, I am told, is because csh requires that
3684f33deaSJordan K. Hubbardthe environment be set up in certain ways, which cron doesn't do.
3784f33deaSJordan K. Hubbard(Actually, I believe, it is because /etc/rc, which runs cron, doesn't
3884f33deaSJordan K. Hubbardset up the environment enough for csh to run, and cron just inherits
3984f33deaSJordan K. Hubbardthe situation.)  Anyway, the point is that if you find out what csh
4084f33deaSJordan K. Hubbardreally needs in its environment, you might want to set up cron to
4184f33deaSJordan K. Hubbardprovide some reasonable defaults (if it isn't supplied by cron's
4284f33deaSJordan K. Hubbardparent).  Also, could you tell me what csh needs, if you find out, so
4384f33deaSJordan K. Hubbardwe can hack our /etc/rc?
4484f33deaSJordan K. Hubbard
4584f33deaSJordan K. Hubbard<<	well, the environment IS a problem. processes that cron forks
4684f33deaSJordan K. Hubbard	will inherit the environment of the person who ran the cron
4784f33deaSJordan K. Hubbard	daemon... I plan to edit out such useless things as TERMCAP,
4884f33deaSJordan K. Hubbard	TERM, and the like; supply correct values for HOME, USER, CWD,
4984f33deaSJordan K. Hubbard	and whatever else comes to mind.  I'll make sure csh works...	>>
5084f33deaSJordan K. HubbardFrom ptsfa!ames!seismo!dgis!generous Thu Jan  1 07:33:17 1987
5184f33deaSJordan K. HubbardDate: Thu Jan 1 10:29:20 1987
5284f33deaSJordan K. HubbardFrom: ames!seismo!dgis!generous (Curtis Generous)
5384f33deaSJordan K. HubbardTo: nike!ptsfa!vixie!paul
5484f33deaSJordan K. HubbardStatus: RO
5584f33deaSJordan K. Hubbard
5684f33deaSJordan K. HubbardPaul:
5784f33deaSJordan K. Hubbard
5884f33deaSJordan K. HubbardOne of the limitations of the present versions of cron is the lack
5984f33deaSJordan K. Hubbardof the capability of specifying a way to execute a command every
6084f33deaSJordan K. Hubbardn units of time.
6184f33deaSJordan K. Hubbard
6284f33deaSJordan K. HubbardHere is a good example:
6384f33deaSJordan K. Hubbard
6484f33deaSJordan K. Hubbard# Present method to start up uucico
6584f33deaSJordan K. Hubbard02,12,22,32,42,52 * * * * 	exec /usr/lib/uucp/uucico -r1
6684f33deaSJordan K. Hubbard
6784f33deaSJordan K. Hubbard# New method ?? (the ':' here is just one possibility for syntax)
6884f33deaSJordan K. Hubbard02:10 * * * *			exec /usr/lib/uucp/uucico -r1
6984f33deaSJordan K. Hubbard
7084f33deaSJordan K. HubbardThis method would prove very helpful for those programs that get started
7184f33deaSJordan K. Hubbardevery few minutes, making the entry long and not easily readable.  The first
7284f33deaSJordan K. Hubbardnumber would specify the base time, and the second number the repetition
7384f33deaSJordan K. Hubbardinterval.
7484f33deaSJordan K. Hubbard
7584f33deaSJordan K. Hubbard<<	Good idea, but bob@acornrc beat you to it.  I used '/' instead of
7684f33deaSJordan K. Hubbard	':'.  This is my personal preference, and seems intuitive when you
7784f33deaSJordan K. Hubbard	think of the divide operator in C... Does anyone have a preference? >>
7884f33deaSJordan K. Hubbard
7984f33deaSJordan K. HubbardFrom ptsfa!lll-lcc!seismo!decuac!c3pe!c3engr!charles Thu Jan  1 17:04:24 1987
8084f33deaSJordan K. HubbardFrom: lll-lcc!seismo!c3pe!c3engr!charles (Charles Green)
8184f33deaSJordan K. HubbardTo: c3pe!decuac!dolqci!vrdxhq!seismo!lll-lcc!ptsfa!vixie!paul
8284f33deaSJordan K. HubbardDate: Thu Jan  1 19:22:47 1987
8384f33deaSJordan K. HubbardStatus: RO
8484f33deaSJordan K. Hubbard
8584f33deaSJordan K. HubbardWell, this isn't a compatible extension, but I have in times past wondered
8684f33deaSJordan K. Hubbardabout a facility to let you start a process at intervals of, say, 17 minutes,
8784f33deaSJordan K. Hubbardinstead of particular minutes out of each hour.
8884f33deaSJordan K. Hubbard
8984f33deaSJordan K. Hubbard<<	This was a popular request!	>>
9084f33deaSJordan K. Hubbard
9184f33deaSJordan K. HubbardFrom seismo!uwvax!astroatc!nicmad!norvax!mann Sun Jan  4 13:04:01 1987
9284f33deaSJordan K. HubbardDate: Fri, 2 Jan 87 09:23:53 cst
9384f33deaSJordan K. HubbardFrom: lll-lcc!seismo!uwvax!astroatc!nicmad!norvax!mann (Tom Mann)
9484f33deaSJordan K. HubbardTo: ptsfa!vixie!paul
9584f33deaSJordan K. HubbardStatus: RO
9684f33deaSJordan K. Hubbard
9784f33deaSJordan K. HubbardI'm not sure if it is in cron (either SysV or BSD ... if it is, I haven't
9884f33deaSJordan K. Hubbardfigured it out ) but a comment feature would SURE BE NICE!.
9984f33deaSJordan K. HubbardThere are times when I want to comment out an entry
10084f33deaSJordan K. Hubbardfor a period of time; it might also make it a lot more legible.
10184f33deaSJordan K. Hubbard
10284f33deaSJordan K. Hubbard<<	My cron allows blank lines and standard #-type comments.  I know
10384f33deaSJordan K. Hubbard	that one BSD4.2 cron I've used had it.  I don't know about SysV.  >>
10484f33deaSJordan K. Hubbard
10584f33deaSJordan K. HubbardFrom ptsfa!hoptoad!hugh Mon Jan  5 10:26:46 1987
10684f33deaSJordan K. HubbardDate: Mon, 5 Jan 87 01:22:17 PST
10784f33deaSJordan K. HubbardFrom: hoptoad!hugh (Hugh Daniel)
10884f33deaSJordan K. HubbardTo: ptsfa!vixie!paul
10984f33deaSJordan K. HubbardStatus: RO
11084f33deaSJordan K. Hubbard
11184f33deaSJordan K. Hubbard  Hi, I do have a BIG one that I would like.  I want to log ALL output
11284f33deaSJordan K. Hubbardfrom command lines into a file for each line.  Thus I might have a chance
11384f33deaSJordan K. Hubbardof finding out why my crontab entry did not work.
11484f33deaSJordan K. Hubbard  This would seem to work best if done by cron, as it is now I have a google
11584f33deaSJordan K. Hubbardof shell scripts laying about just to put the error output where I can see
11684f33deaSJordan K. Hubbardit.
11784f33deaSJordan K. Hubbard
11884f33deaSJordan K. Hubbard<<	My cron (and the SysV cron) will send mail to the owner of the
11984f33deaSJordan K. Hubbard	particular crontab file if a command generates any output on stdout
12084f33deaSJordan K. Hubbard	or stderr.  This can be irritating, but if you write a script such
12184f33deaSJordan K. Hubbard	that any output means a problem occurred, you can avoid most logfile
12284f33deaSJordan K. Hubbard	needs, and not generate mail except in unforeseen circumstances.   >>
12384f33deaSJordan K. Hubbard
12484f33deaSJordan K. HubbardFrom ptsfa!dual!ucbvax!ihnp4!anvil!es!Robert_Toxen Mon Jan  5 13:08:46 1987
12584f33deaSJordan K. HubbardFrom: dual!ucbvax!ihnp4!anvil!es!Robert_Toxen
12684f33deaSJordan K. HubbardDate: Fri,  2 Jan 87 14:25:29 EST
12784f33deaSJordan K. HubbardTo: anvil!ihnp4!ucbvax!dual!ptsfa!vixie!paul
12884f33deaSJordan K. HubbardStatus: RO
12984f33deaSJordan K. Hubbard
13084f33deaSJordan K. HubbardHere are some suggestions:
13184f33deaSJordan K. Hubbard1. Run it through the C preprocessor via "/lib/<whatever>".
13284f33deaSJordan K. Hubbard
13384f33deaSJordan K. Hubbard<<	hmmm. this seems of limited utility, and if you really wanted
13484f33deaSJordan K. Hubbard	to do it that way, you could do it yourself (since users can
13584f33deaSJordan K. Hubbard	write to their own crontab files).  I'll add '-' (read stdin)
13684f33deaSJordan K. Hubbard	to the crontab installer program to facilitate this.		>>
13784f33deaSJordan K. Hubbard
13884f33deaSJordan K. Hubbard2. Allow specifying every Nth day of week, i.e., every second Wednesday.
13984f33deaSJordan K. Hubbard   I did this to calendar by separating the day of week (Wed=4, which one
14084f33deaSJordan K. Hubbard   to start on and N with slashes).  I took modulo the day of year as a
14184f33deaSJordan K. Hubbard   starting point so that someone with a desk calendar documenting such
14284f33deaSJordan K. Hubbard   things can easily determine the offset (second number).  I did this
14384f33deaSJordan K. Hubbard   while at SGI; alas I don't have a copy of the code.
14484f33deaSJordan K. Hubbard
14584f33deaSJordan K. Hubbard<<	I can see how this could be useful, but I'm not sure how I'd
14684f33deaSJordan K. Hubbard	implement it.  Cron currently doesn't keep track of the last time
14784f33deaSJordan K. Hubbard	a given command was run; whether the current Wednesday is the first
14884f33deaSJordan K. Hubbard	or second since the command was last run would be pretty hard to
14984f33deaSJordan K. Hubbard	figure out.  I'd have to keep a database of commands and their
15084f33deaSJordan K. Hubbard	execution around, and purge it when the crontab was overwritten.
15184f33deaSJordan K. Hubbard	This is too much work for me, but if someone adds it, let me know.  >>
15284f33deaSJordan K. Hubbard
15384f33deaSJordan K. HubbardFrom ptsfa!ames!seismo!cbmvax!devon!paul Tue Jan  6 05:50:17 1987
15484f33deaSJordan K. HubbardFrom: ames!seismo!cbmvax!devon!paul
15584f33deaSJordan K. HubbardTo: cbmvax!seismo!nike!ptsfa!vixie!paul
15684f33deaSJordan K. HubbardDate: Mon Jan  5 09:29:57 1987
15784f33deaSJordan K. HubbardStatus: RO
15884f33deaSJordan K. Hubbard
15984f33deaSJordan K. HubbardOne problem that has always plagued me with cron is the assumed ORing.
16084f33deaSJordan K. HubbardI'd like to see some type of ANDing implemented.  I guess I can best
16184f33deaSJordan K. Hubbarddescribe this by example.  Say I have the following line in my crontab
16284f33deaSJordan K. Hubbardfile:
16384f33deaSJordan K. Hubbard
16484f33deaSJordan K. Hubbard*  *  4-31  *  1-6	/usr/bin/command
16584f33deaSJordan K. Hubbard
16684f33deaSJordan K. HubbardWhat this does is run 'command' on the 4th thru 31st days of the
16784f33deaSJordan K. Hubbardmonth, AND on Monday thru Saturday; which probably means running it
16884f33deaSJordan K. Hubbardevery day of the month (unless Sunday falls on days 1-3).  This
16984f33deaSJordan K. Hubbardhappens because cron runs the command if the day-of-month OR the
17084f33deaSJordan K. Hubbardday-of-week is true.
17184f33deaSJordan K. Hubbard
17284f33deaSJordan K. HubbardWhat I'd like to happen with the above line is to run the command ONLY
17384f33deaSJordan K. Hubbardon Monday thru Saturday any time after the 3rd of the month, e.g. if
17484f33deaSJordan K. Hubbardthe day-of-month AND the day-of-week are true.
17584f33deaSJordan K. Hubbard
17684f33deaSJordan K. HubbardMy proposal to you is to implement some special chars for the first
17784f33deaSJordan K. Hubbardfive fields.  Examples:
17884f33deaSJordan K. Hubbard
17984f33deaSJordan K. Hubbard*  *  !1-3  *  1-6	/usr/bin/command
18084f33deaSJordan K. Hubbard
18184f33deaSJordan K. Hubbard(run command Mon-Sat, but NOT [!] on the first 3 days of the month)
18284f33deaSJordan K. Hubbard
18384f33deaSJordan K. Hubbard*  *  &4-31 *  &1-6	/usr/bin/command
18484f33deaSJordan K. Hubbard
18584f33deaSJordan K. Hubbard(run command if day-of-month AND day-of-week are true)
18684f33deaSJordan K. Hubbard
1873df5ecacSUlrich SpörleinGet the picture?  This would be compatible with existing versions of
18884f33deaSJordan K. Hubbardcron (which wouldn't currently be using any special characters, so
18984f33deaSJordan K. Hubbardthat old crontabs would be handled correctly).
19084f33deaSJordan K. Hubbard
19184f33deaSJordan K. Hubbard<<	This message made me aware of the actual boolean expression involved
19284f33deaSJordan K. Hubbard	in a crontab entry.  I'd assumed that it was
19384f33deaSJordan K. Hubbard		(minute && hour && DoM && month && DoW)
19484f33deaSJordan K. Hubbard	But it's really
19584f33deaSJordan K. Hubbard		(minute && hour && month && (DoM || DoW))
19684f33deaSJordan K. Hubbard
19784f33deaSJordan K. Hubbard	I can see some value in changing this, but with a fixed order of
19884f33deaSJordan K. Hubbard	fields, operators get to be kindof unary, which && and || really
19984f33deaSJordan K. Hubbard	aren't.  If someone has an idea on a syntax that allows useful
20084f33deaSJordan K. Hubbard	variations to the standard (&& && && (||)) default, please suggest. >>
20184f33deaSJordan K. Hubbard
20284f33deaSJordan K. HubbardFrom bobkat!pedz Tue Jan  6 20:02:10 1987
20384f33deaSJordan K. HubbardFrom: pedz@bobkat.UUCP (Pedz Thing)
20484f33deaSJordan K. HubbardDate: 2 Jan 87 17:34:44 GMT
20584f33deaSJordan K. HubbardStatus: RO
20684f33deaSJordan K. Hubbard
20784f33deaSJordan K. HubbardLog files!  It would be nice to be able to specify a log for cron
20884f33deaSJordan K. Hubbarditself and also a log for each program's stdout and stderr to go to.
20984f33deaSJordan K. HubbardThe latter can of course be done with > and 2> but it would be nice if
21084f33deaSJordan K. Hubbardthere could be a single line with some sort of pattern like
21184f33deaSJordan K. Hubbard`> /usr/spool/log/%' and the command would be substituted for the %.
21284f33deaSJordan K. HubbardAnother thing which would be nice is to be able to specify which shell
21384f33deaSJordan K. Hubbardto call to give the command to.
21484f33deaSJordan K. Hubbard
21584f33deaSJordan K. Hubbard<<	Log files are done with mail.  The '%' idea could be useful if
21684f33deaSJordan K. Hubbard	a different character were used (% is special to cron, see man
21784f33deaSJordan K. Hubbard	page); a different directory would have to be chosen, since each
21884f33deaSJordan K. Hubbard	user has their own crontab file; and something intelligent would
21984f33deaSJordan K. Hubbard	have to be done in the file naming, since the first word of the
22084f33deaSJordan K. Hubbard	command might be ambiguous (with other commands).  In short, it's
22184f33deaSJordan K. Hubbard	too much work.  Sorry.						  >>
22284f33deaSJordan K. Hubbard
22384f33deaSJordan K. HubbardFrom guy%gorodish@sun Tue Jan  6 20:03:13 1987
22484f33deaSJordan K. HubbardFrom: guy%gorodish@sun (Guy Harris)
22584f33deaSJordan K. HubbardMessage-ID: <10944@sun.uucp>
22684f33deaSJordan K. HubbardDate: 5 Jan 87 12:09:09 GMT
22784f33deaSJordan K. HubbardReferences: <429@vixie.UUCP> <359@bobkat.UUCP>
22884f33deaSJordan K. HubbardSender: news@sun.uucp
22984f33deaSJordan K. HubbardStatus: RO
23084f33deaSJordan K. Hubbard
23184f33deaSJordan K. Hubbard> Another thing which would be nice is to be able to specify which shell
23284f33deaSJordan K. Hubbard> to call to give the command to.
23384f33deaSJordan K. Hubbard
23484f33deaSJordan K. HubbardWell, the obvious choice would be the user's shell, but this wouldn't work
23584f33deaSJordan K. Hubbardfor accounts like "uucico".
23684f33deaSJordan K. Hubbard
23784f33deaSJordan K. Hubbard<<	I use the owning user's shell, and to handle "uucico" I check a
23884f33deaSJordan K. Hubbard	list of "acceptable shells" (currently compiled in, does anybody
23984f33deaSJordan K. Hubbard	mind?), substituting a default (compiled in) shell if the user's
24084f33deaSJordan K. Hubbard	shell isn't on the list.
24184f33deaSJordan K. Hubbard
24284f33deaSJordan K. Hubbard	BTW, "compiled in" means that it's in a .h file, easily changed
24384f33deaSJordan K. Hubbard	during installation, but requiring recompilation to modify.  You
24484f33deaSJordan K. Hubbard	don't have to go digging through the code to find it...		  >>
24584f33deaSJordan K. Hubbard
24684f33deaSJordan K. HubbardFrom qantel!hplabs!ucbvax!mwm@violet.berkeley.edu Tue Jan  6 21:24:48 1987
24784f33deaSJordan K. HubbardTo: hplabs!qantel!vixie!paul (Paul Vixie Esq)
24884f33deaSJordan K. HubbardDate: 04 Jan 87 00:42:35 PST (Sun)
24984f33deaSJordan K. HubbardFrom: Mike Meyer <mwm@violet.berkeley.edu>
25084f33deaSJordan K. HubbardStatus: RO
25184f33deaSJordan K. Hubbard
25284f33deaSJordan K. Hubbard<<[Discussion of RMS/FSF, and mwm's GNU Cron deleted]>>
25384f33deaSJordan K. Hubbard
25484f33deaSJordan K. HubbardOh, yeah - here are the extensions on my cron:
25584f33deaSJordan K. Hubbard
25684f33deaSJordan K. Hubbard1) Sunday is both day 0 and day 7, so it complies with both SysV and
25784f33deaSJordan K. HubbardBSD cron.
25884f33deaSJordan K. Hubbard
25984f33deaSJordan K. Hubbard<<	Good idea. I did it too, thanks for informing me.	>>
26084f33deaSJordan K. Hubbard
26184f33deaSJordan K. Hubbard2) At is integrated into the cron. Instead of atrun to scan the
26284f33deaSJordan K. Hubbard/usr/spool/at directory, at files are put into the /usr/lib/cron
26384f33deaSJordan K. Hubbarddirectory along with users cron files, and cron fabricates a line from
26484f33deaSJordan K. Hubbarda crontab file to run them. This is considered a major win by all who
26584f33deaSJordan K. Hubbarduse it.
26684f33deaSJordan K. Hubbard
26784f33deaSJordan K. Hubbard<<	I don't use 'at', and my cron doesn't do anything with it.  To run
26884f33deaSJordan K. Hubbard	'at', I use 'atrun' the same way the current BSD cron does.  My
26984f33deaSJordan K. Hubbard	crontab files are in /usr/spool/cron/crontabs, in the SysV
27084f33deaSJordan K. Hubbard	tradition -- not in /usr/lib/cron.  This is a configuration
27184f33deaSJordan K. Hubbard	parameter, of course.						>>
27284f33deaSJordan K. Hubbard
27384f33deaSJordan K. HubbardThere are two known restrictions:
27484f33deaSJordan K. Hubbard
27584f33deaSJordan K. Hubbard1) I don't support any of the SysV security hooks. I don't have a use
27684f33deaSJordan K. Hubbardfor them, and RMS didn't like the idea at all :-).
27784f33deaSJordan K. Hubbard
27884f33deaSJordan K. Hubbard<<	This means cron.allow and cron.deny.  I plan to support them, as
27984f33deaSJordan K. Hubbard	they've been quite helpful at various HPUX sites I've administered. >>
28084f33deaSJordan K. Hubbard
28184f33deaSJordan K. Hubbard2) Cron expects to be able to create files with names longer than 14
28284f33deaSJordan K. Hubbardcharacters, which makes it hard to run on SysV. At least one person
28384f33deaSJordan K. Hubbardwas working on a port, but I don't know how it's going. That might
28484f33deaSJordan K. Hubbardmake for a good reason for releasing yours, right there.
28584f33deaSJordan K. Hubbard
28684f33deaSJordan K. Hubbard<<	If someone has SysV (with the 14-character limit), they probably
28784f33deaSJordan K. Hubbard	won't want my cron, since it doesn't add much to the standard
28884f33deaSJordan K. Hubbard	version (which they may have support for).  My cron is not currently
28984f33deaSJordan K. Hubbard	portable to non-BSD systems, since it relies on interval timers (I
29084f33deaSJordan K. Hubbard	needed to sleep for intervals more granular than seconds alone would
29184f33deaSJordan K. Hubbard	allow).  The port would be trivial, and I will do it if a lot of
29284f33deaSJordan K. Hubbard	people ask for it...						>>
29384f33deaSJordan K. Hubbard
29484f33deaSJordan K. HubbardOh, yeah - I'm going to see about getting this cron integrated into
29584f33deaSJordan K. Hubbardthe next 4BSD release.
29684f33deaSJordan K. Hubbard
29784f33deaSJordan K. Hubbard<<	How does one go about this?  I have a few nifty gadgets I'd like
29884f33deaSJordan K. Hubbard	to contribute, this cron being one of them...			>>
29984f33deaSJordan K. Hubbard
30084f33deaSJordan K. Hubbard<<[more FSF/GNU discussion deleted]>>
30184f33deaSJordan K. Hubbard
30284f33deaSJordan K. HubbardFrom qantel!hplabs!ames!ut-sally!ut-ngp!melpad!bigtex!james Tue Jan  6 21:24:57 1987
30384f33deaSJordan K. HubbardPosted-Date: Fri, 2 Jan 87 19:26:16 est
30484f33deaSJordan K. HubbardDate: Fri, 2 Jan 87 19:26:16 est
30584f33deaSJordan K. HubbardFrom: hplabs!ames!ut-sally!ut-ngp!bigtex!james
30684f33deaSJordan K. HubbardTo: vixie!paul
30784f33deaSJordan K. HubbardStatus: RO
30884f33deaSJordan K. Hubbard
30984f33deaSJordan K. HubbardYes!!!  There are several critical failures in System V cron...
31084f33deaSJordan K. Hubbard
31184f33deaSJordan K. Hubbard1. Pass all variables in cron's environment into the environment of things
31284f33deaSJordan K. Hubbard   cron starts up, or at least into the crontab entries started up (at jobs
31384f33deaSJordan K. Hubbard   will inherit the environment of the user).  If nothing else it is critically
31484f33deaSJordan K. Hubbard   important that the TZ variable be passed on.  PATH should be passed on too.
31584f33deaSJordan K. Hubbard   Basically, passing environment values allows one to design a standard
31684f33deaSJordan K. Hubbard   environment with TZ and PATH and have that run by everything.  If anyone
31784f33deaSJordan K. Hubbard   tells you this is no big deal, consider what happens when uucico is
31884f33deaSJordan K. Hubbard   started by cron in CA to make a long distance phone link...  Unless the
31984f33deaSJordan K. Hubbard   administrator is really on his/her toes, calls scheduled at 5pm will really
32084f33deaSJordan K. Hubbard   go at two in the afternoon, needlessly incurring huge phone bills, all
32184f33deaSJordan K. Hubbard   because System V refuses to pass the TZ from its environment down.  There
32284f33deaSJordan K. Hubbard   are work arounds, but only putting it in cron will really work.  This is
32384f33deaSJordan K. Hubbard   not a security hole.
32484f33deaSJordan K. Hubbard
32584f33deaSJordan K. Hubbard<<	delete TERM and TERMCAP; modify HOME, USER, and CWD; pass TZ and
32684f33deaSJordan K. Hubbard	PATH through undisturbed.  any other requests out there?
32784f33deaSJordan K. Hubbard
32884f33deaSJordan K. Hubbard	BSD doesn't have this problem -- TZ is passed right on through if
32984f33deaSJordan K. Hubbard	you define it in the shell before starting my cron daemon.  However,
33084f33deaSJordan K. Hubbard	the BSD I'm running this on doesn't need TZ to be defined anyway...
33184f33deaSJordan K. Hubbard	The default in the kernel has been just fine so far...  But just the
33284f33deaSJordan K. Hubbard	same, if/when I port to SysV (I guess I really should), I'll make
33384f33deaSJordan K. Hubbard	sure this works right.
33484f33deaSJordan K. Hubbard
33584f33deaSJordan K. Hubbard	I guess I've been spoiled.  HPUX is SysV-based, and I never had a
33684f33deaSJordan K. Hubbard	problem with cron and TZ when I used it.			  >>
33784f33deaSJordan K. Hubbard
33884f33deaSJordan K. Hubbard2. A way to avoid logging stuff in /usr/lib/cron/log.  I have a cron entry
33984f33deaSJordan K. Hubbard   run uudemon.hr every 10 minutes.  This is 144 times/day.  Each run generates
34084f33deaSJordan K. Hubbard   three lines of text, for a total of 432 lines of text I don't want to see.
34184f33deaSJordan K. Hubbard   Obviously this should be optional, but it would be nice if there were a
34284f33deaSJordan K. Hubbard   way to flag an entry so that it wasn't logged at all unless there was an
34384f33deaSJordan K. Hubbard   error.
34484f33deaSJordan K. Hubbard
34584f33deaSJordan K. Hubbard<<	I don't know nothin' 'bout no /usr/lib/cron/log.  What is this file?
34684f33deaSJordan K. Hubbard	I don't see any reason to create log entries, given the mail-the-
34784f33deaSJordan K. Hubbard	output behaviour.  Opinions, anyone?				>>
34884f33deaSJordan K. Hubbard
34984f33deaSJordan K. HubbardI will come up with other ideas no doubt, but I can always implement them
35084f33deaSJordan K. Hubbardmyself.
35184f33deaSJordan K. Hubbard
35284f33deaSJordan K. Hubbard<<	That's what I like about PD software.  Please send me the diffs!  >>
35384f33deaSJordan K. Hubbard
35484f33deaSJordan K. HubbardThe other problem you have is making sure you can run standard
35584f33deaSJordan K. Hubbardcrontabs.  I would suggest something like this: if the command part of the
35684f33deaSJordan K. Hubbardentry starts with an unescaped -, then flags and options follow immediately
35784f33deaSJordan K. Hubbardthereafter.  As in:
35884f33deaSJordan K. Hubbard
35984f33deaSJordan K. Hubbard2,12,22,32,42,52 * * * * -q /usr/lib/uucp/uudemon.hr
36084f33deaSJordan K. Hubbard
36184f33deaSJordan K. HubbardThis could mean do not log the uudemon.hr run unless there is a problem of
36284f33deaSJordan K. Hubbardsome kind.  This is probably safe as not many filenames start with "-", and
36384f33deaSJordan K. Hubbardthose that do are already a problem for people.
36484f33deaSJordan K. Hubbard
36584f33deaSJordan K. Hubbard<<	Since I don't plan on supporting /usr/lib/cron/log in ANY form unless
36684f33deaSJordan K. Hubbard	many people request it, I won't be needing -q as you've defined it.
36784f33deaSJordan K. Hubbard	I could use something like this to avoid sending mail on errors, for
36884f33deaSJordan K. Hubbard	the occasional script that you don't want to bullet-proof.
36984f33deaSJordan K. Hubbard
37084f33deaSJordan K. Hubbard	The compatibility issue is CRITICAL.  The 4.3BSD crontab format is
37184f33deaSJordan K. Hubbard	a crime against the whole philosophy of Unix(TM), in my opinion.   >>
37284f33deaSJordan K. Hubbard
37384f33deaSJordan K. HubbardOne other minor thing to consider is the ulimit: can different users get
37484f33deaSJordan K. Hubbarddifferent ulimits for their crontab entries?
37584f33deaSJordan K. Hubbard
37684f33deaSJordan K. Hubbard<<	Boy I'm ignorant today.  What's a ulimit, and what should I do with
37784f33deaSJordan K. Hubbard	it in a crontab?  Suggestions, enlightenment, etc ??		   >>
37884f33deaSJordan K. Hubbard
37984f33deaSJordan K. HubbardFrom qantel!lll-crg!ames!uw-beaver!uw-nsr!john Tue Jan  6 23:32:44 1987
38084f33deaSJordan K. HubbardDate: Thu, 1 Jan 87 10:53:05 pst
38184f33deaSJordan K. HubbardFrom: lll-crg!ames!uw-beaver!uw-nsr!john (John Sambrook 5-7433)
38284f33deaSJordan K. HubbardTo: vixie!paul
38384f33deaSJordan K. HubbardStatus: RO
38484f33deaSJordan K. Hubbard
38584f33deaSJordan K. HubbardHow about not hardwiring the default environment that cron builds for its
38684f33deaSJordan K. Hubbardchildren in the cron program itself?  Our cron does this and it's the pits
38784f33deaSJordan K. Hubbardbecause we are TZ=PST8PDT not TZ=EST5EDT !
38884f33deaSJordan K. Hubbard
38984f33deaSJordan K. Hubbard<<	yeachk.  I assure you, I will not hardwire the TZ!		>>
39084f33deaSJordan K. HubbardFrom ptsfa!well!dv Fri Jan  9 04:01:50 1987
39184f33deaSJordan K. HubbardDate: Thu, 8 Jan 87 23:50:40 pst
39284f33deaSJordan K. HubbardFrom: well!dv (David W. Vezie)
39384f33deaSJordan K. HubbardTo: ptsfa!vixie!paul
39484f33deaSJordan K. HubbardStatus: RO
39584f33deaSJordan K. Hubbard
39684f33deaSJordan K. Hubbard6, have a special notation called 'H' which would expand to weekends
39784f33deaSJordan K. Hubbard   and holidays (you'd have to keep a database somewhere of real
39884f33deaSJordan K. Hubbard   holidays), and also 'W' for workdays (neither weekend or holiday).
39984f33deaSJordan K. Hubbard
40084f33deaSJordan K. Hubbard<<	Too much work.  There should be a standard way to define and
40184f33deaSJordan K. Hubbard	detect holidays under Unix(TM); if there were, I'd use it.  As
40284f33deaSJordan K. Hubbard	it is, I'll leave this for someone else to add.
40384f33deaSJordan K. Hubbard
40484f33deaSJordan K. Hubbard	I can see the usefulness; it just doesn't quite seem worth it.    >>
40584f33deaSJordan K. HubbardFrom qantel!gatech!akgua!blnt1!jat Wed Jan 14 20:00:40 1987
40684f33deaSJordan K. HubbardDate: Tue, 13 Jan 87 16:39:38 EST
40784f33deaSJordan K. HubbardFrom: gatech!akgua!blnt1!jat
40884f33deaSJordan K. HubbardStatus: RO
40984f33deaSJordan K. Hubbard
41084f33deaSJordan K. Hubbard1) Add some way to tell cron to reread the files, say kill -1 <pid>
41184f33deaSJordan K. Hubbard
41284f33deaSJordan K. Hubbard<<	whenever the 'crontab' program is run and updates a crontab file,
41384f33deaSJordan K. Hubbard	a file /usr/spool/cron/POKECRON is created; next time the cron
41484f33deaSJordan K. Hubbard	daemon wakes up, it sees it, and re-reads the crontab files.
41584f33deaSJordan K. Hubbard
41684f33deaSJordan K. Hubbard	I thought of handling the signal; even implemented it.  Then this
41784f33deaSJordan K. Hubbard	clever idea hit me and I ripped it all out and added a single
41884f33deaSJordan K. Hubbard	IF-statement to handle the POKECRON file.			>>
41984f33deaSJordan K. Hubbard
42084f33deaSJordan K. Hubbard2) Have some kind of retry time so that if a command fails, cron will try to
42184f33deaSJordan K. Hubbard   execute it again after a certain period.  This is useful if you have some
42284f33deaSJordan K. Hubbard   type of cleanup program that can run at the scheduled time for some reason
42384f33deaSJordan K. Hubbard   (such as locked device, unmounted filesystem, etc).
42484f33deaSJordan K. Hubbard
42584f33deaSJordan K. Hubbard<<	Hmmm, sounds useful.  I could do this by submitting an 'at' job...
42684f33deaSJordan K. Hubbard	I'll think about it.						>>
42784f33deaSJordan K. HubbardFrom ptsfa!dual!ucbvax!ihnp4!mtuxo!ender Sat Jan  3 16:54:00 1987
42884f33deaSJordan K. HubbardFrom: dual!ucbvax!ihnp4!mtuxo!ender
42984f33deaSJordan K. HubbardDate: Sat, 3 Jan 87 14:05:13 PST
43084f33deaSJordan K. HubbardTo: ucbvax!dual!ptsfa!vixie!paul
43184f33deaSJordan K. HubbardStatus: RO
43284f33deaSJordan K. Hubbard
43384f33deaSJordan K. HubbardIt would be nice if nonprivileged users can setup personal crontab files
43484f33deaSJordan K. Hubbard(~/.cronrc, say) and be able to run personal jobs at regular intervals.
43584f33deaSJordan K. Hubbard
43684f33deaSJordan K. Hubbard<<	this is done, but in the SysV style: the 'crontab' program installs
43784f33deaSJordan K. Hubbard	a new crontab file for the executing user (can be overridden by root
43884f33deaSJordan K. Hubbard	for setup of uucp and news).  the advantage of this is that (1) when
43984f33deaSJordan K. Hubbard	a crontab is changed, the daemon can be informed automatically; and
44084f33deaSJordan K. Hubbard	(2) the file can be syntax-checked before installation.		>>
44184f33deaSJordan K. HubbardFrom ptsfa!ames!seismo!ihnp4!lcc!richard Fri Jan 16 04:47:33 1987
44284f33deaSJordan K. HubbardDate: Fri, 16 Jan 87 07:44:57 EST
44384f33deaSJordan K. HubbardTo: nike!ptsfa!vixie!paul
44484f33deaSJordan K. HubbardStatus: RO
44584f33deaSJordan K. Hubbard
44684f33deaSJordan K. HubbardThe System V cron is nice, but it has a few annoying features.  One is that
44784f33deaSJordan K. Hubbardits mail files will say that the previous message is the output of "one of your
448*3b31bf26SGordon Berglingcron commands."  I wish it would say WHICH cron command.
44984f33deaSJordan K. Hubbard
45084f33deaSJordan K. Hubbard<<	Done.  Also which shell, which user (useful when the mail gets
45184f33deaSJordan K. Hubbard	forwarded), which home directory, and other useful crud.	>>
45284f33deaSJordan K. Hubbard
45384f33deaSJordan K. HubbardAnother problem is with timezones.  It is necessary to specify TZ=PST8PDT (or
45484f33deaSJordan K. Hubbardwhatever) when you invoke cron (from inittab, or /etc/rc) and it is also
45584f33deaSJordan K. Hubbardnecessary to add TZ=PST8PDT to each crontab line which might need it.  Cron
45684f33deaSJordan K. Hubbardshould automatically export its idea of the "TZ" to each invoked command, and
45784f33deaSJordan K. Hubbardit should be possible to put a line in the crontab file which overrides that
45884f33deaSJordan K. Hubbardfor every command in the file (e.g., most users are on EST, so cron is run
45984f33deaSJordan K. Hubbardwith TZ=EST5EDT; but one user is usually on PST and wants all of his cron
46084f33deaSJordan K. Hubbardcommands to run with TZ=PST8PDT).  This might be extended to allow any
46184f33deaSJordan K. Hubbardenvironment variable to be specified once for the whole crontab file (e.g.,
46284f33deaSJordan K. HubbardPATH).
46384f33deaSJordan K. Hubbard
46484f33deaSJordan K. Hubbard<<	Well, since I run the user's shell, you could put this into .cshrc.
46584f33deaSJordan K. Hubbard	generic environment-variable setting could be useful, though.  Since
46684f33deaSJordan K. Hubbard	I have to modify the environment anyway, I'll consider this.	  >>
46784f33deaSJordan K. Hubbard
46884f33deaSJordan K. HubbardA log file might be a nice idea, but the System V cron log is too verbose.
46984f33deaSJordan K. HubbardI seem to remember that cron keeps it open, too; so you can't even have
47084f33deaSJordan K. Hubbardsomething go and periodically clean it out.
47184f33deaSJordan K. Hubbard
47284f33deaSJordan K. Hubbard<<	I don't do /usr/lib/cron/log.  I wasn't aware of this file until I
47384f33deaSJordan K. Hubbard	got all these suggestions.  Do people want this file?  Tell me!    >>
474