xref: /netbsd-src/external/bsd/cron/dist/MAIL (revision 0061c6a57db8d5f6f7c0f43feb831ed16236a4a2)
1*0061c6a5Schristos[ this is really old mail that came to me in response to my 1986 posting
2*0061c6a5Schristos  to usenet asking for feature suggestions before releasing the first
3*0061c6a5Schristos  version of cron.  it is presented here for its entertainment value.
4*0061c6a5Schristos  --vix ]
5*0061c6a5Schristos
6*0061c6a5SchristosId: MAIL,v 1.1.1.1 1996/12/16 19:39:47 halley Exp
7*0061c6a5Schristos
8*0061c6a5SchristosFrom ptsfa!lll-crg!ames!acornrc!bob Wed Dec 31 10:07:08 1986
9*0061c6a5SchristosDate: Wed, 31 Dec 86 08:59:31 pst
10*0061c6a5SchristosFrom: lll-crg!ames!acornrc!bob (Bob Weissman)
11*0061c6a5SchristosTo: ptsfa!vixie!paul
12*0061c6a5SchristosStatus: RO
13*0061c6a5Schristos
14*0061c6a5SchristosSure, here's a suggestion: I'd like to be able to run a program, say,
15*0061c6a5Schristosevery two hours.  Current cron requires me to write
16*0061c6a5Schristos0,2,4,6,8,10,12,14,16,18,20,22 in the hours field.  How about a notation
17*0061c6a5Schristosto handle this more elegantly?
18*0061c6a5Schristos
19*0061c6a5Schristos<<	Okay, I've allowed 0-22/2 as a means of handling this.
20*0061c6a5Schristos	The time specification for my cron is as follows:
21*0061c6a5Schristos		specification = range {"," range}
22*0061c6a5Schristos		range = (start "-" finish ["/" step]) | single-unit
23*0061c6a5Schristos	This allows "1,3,5-7", which the current cron doesn't (it won't
24*0061c6a5Schristos	do a range inside a list), and handles your specific need.	>>
25*0061c6a5Schristos
26*0061c6a5SchristosFrom drw@mit-eddie Wed Dec 31 18:25:27 1986
27*0061c6a5SchristosDate: Wed, 31 Dec 86 14:28:19 est
28*0061c6a5SchristosFrom: drw@mit-eddie (Dale Worley)
29*0061c6a5SchristosTo: mit-eddie!vixie!paul
30*0061c6a5SchristosStatus: RO
31*0061c6a5Schristos
32*0061c6a5SchristosWe have a lot of lines in our crontab of the form
33*0061c6a5Schristos
34*0061c6a5Schristos	00 12 * * * su user < /usr/users/user/script.file
35*0061c6a5Schristos
36*0061c6a5SchristosThis barfs (silently!) on our system (Dec Ultrix 1.2 == 4.2bsd) if
37*0061c6a5Schristosuser's shell is csh.  This, I am told, is because csh requires that
38*0061c6a5Schristosthe environment be set up in certain ways, which cron doesn't do.
39*0061c6a5Schristos(Actually, I believe, it is because /etc/rc, which runs cron, doesn't
40*0061c6a5Schristosset up the environment enough for csh to run, and cron just inherits
41*0061c6a5Schristosthe situation.)  Anyway, the point is that if you find out what csh
42*0061c6a5Schristosreally needs in its environment, you might want to set up cron to
43*0061c6a5Schristosprovide some reasonable defaults (if it isn't supplied by cron's
44*0061c6a5Schristosparent).  Also, could you tell me what csh needs, if you find out, so
45*0061c6a5Schristoswe can hack our /etc/rc?
46*0061c6a5Schristos
47*0061c6a5Schristos<<	well, the environment IS a problem. processes that cron forks
48*0061c6a5Schristos	will inherit the environment of the person who ran the cron
49*0061c6a5Schristos	daemon... I plan to edit out such useless things as TERMCAP,
50*0061c6a5Schristos	TERM, and the like; supply correct values for HOME, USER, CWD,
51*0061c6a5Schristos	and whatever else comes to mind.  I'll make sure csh works...	>>
52*0061c6a5SchristosFrom ptsfa!ames!seismo!dgis!generous Thu Jan  1 07:33:17 1987
53*0061c6a5SchristosDate: Thu Jan 1 10:29:20 1987
54*0061c6a5SchristosFrom: ames!seismo!dgis!generous (Curtis Generous)
55*0061c6a5SchristosTo: nike!ptsfa!vixie!paul
56*0061c6a5SchristosStatus: RO
57*0061c6a5Schristos
58*0061c6a5SchristosPaul:
59*0061c6a5Schristos
60*0061c6a5SchristosOne of the limitations of the present versions of cron is the lack
61*0061c6a5Schristosof the capability of specifying a way to execute a command every
62*0061c6a5Schristosn units of time.
63*0061c6a5Schristos
64*0061c6a5SchristosHere is a good example:
65*0061c6a5Schristos
66*0061c6a5Schristos# Present method to start up uucico
67*0061c6a5Schristos02,12,22,32,42,52 * * * * 	exec /usr/lib/uucp/uucico -r1
68*0061c6a5Schristos
69*0061c6a5Schristos# New method ?? (the ':' here is just one possibility for syntax)
70*0061c6a5Schristos02:10 * * * *			exec /usr/lib/uucp/uucico -r1
71*0061c6a5Schristos
72*0061c6a5SchristosThis method would prove very helpful for those programs that get started
73*0061c6a5Schristosevery few minutes, making the entry long and not easily readable.  The first
74*0061c6a5Schristosnumber would specify the base time, and the second number the repetition
75*0061c6a5Schristosinterval.
76*0061c6a5Schristos
77*0061c6a5Schristos<<	Good idea, but bob@acornrc beat you to it.  I used '/' instead of
78*0061c6a5Schristos	':'.  This is my personal preference, and seems intuitive when you
79*0061c6a5Schristos	think of the divide operator in C... Does anyone have a preference? >>
80*0061c6a5Schristos
81*0061c6a5SchristosFrom ptsfa!lll-lcc!seismo!decuac!c3pe!c3engr!charles Thu Jan  1 17:04:24 1987
82*0061c6a5SchristosFrom: lll-lcc!seismo!c3pe!c3engr!charles (Charles Green)
83*0061c6a5SchristosTo: c3pe!decuac!dolqci!vrdxhq!seismo!lll-lcc!ptsfa!vixie!paul
84*0061c6a5SchristosDate: Thu Jan  1 19:22:47 1987
85*0061c6a5SchristosStatus: RO
86*0061c6a5Schristos
87*0061c6a5SchristosWell, this isn't a compatible extension, but I have in times past wondered
88*0061c6a5Schristosabout a facility to let you start a process at intervals of, say, 17 minutes,
89*0061c6a5Schristosinstead of particular minutes out of each hour.
90*0061c6a5Schristos
91*0061c6a5Schristos<<	This was a popular request!	>>
92*0061c6a5Schristos
93*0061c6a5SchristosFrom seismo!uwvax!astroatc!nicmad!norvax!mann Sun Jan  4 13:04:01 1987
94*0061c6a5SchristosDate: Fri, 2 Jan 87 09:23:53 cst
95*0061c6a5SchristosFrom: lll-lcc!seismo!uwvax!astroatc!nicmad!norvax!mann (Tom Mann)
96*0061c6a5SchristosTo: ptsfa!vixie!paul
97*0061c6a5SchristosStatus: RO
98*0061c6a5Schristos
99*0061c6a5SchristosI'm not sure if it is in cron (either SysV or BSD ... if it is, I haven't
100*0061c6a5Schristosfigured it out ) but a comment feature would SURE BE NICE!.
101*0061c6a5SchristosThere are times when I want to comment out an entry
102*0061c6a5Schristosfor a period of time; it might also make it a lot more legible.
103*0061c6a5Schristos
104*0061c6a5Schristos<<	My cron allows blank lines and standard #-type comments.  I know
105*0061c6a5Schristos	that one BSD4.2 cron I've used had it.  I don't know about SysV.  >>
106*0061c6a5Schristos
107*0061c6a5SchristosFrom ptsfa!hoptoad!hugh Mon Jan  5 10:26:46 1987
108*0061c6a5SchristosDate: Mon, 5 Jan 87 01:22:17 PST
109*0061c6a5SchristosFrom: hoptoad!hugh (Hugh Daniel)
110*0061c6a5SchristosTo: ptsfa!vixie!paul
111*0061c6a5SchristosStatus: RO
112*0061c6a5Schristos
113*0061c6a5Schristos  Hi, I do have a BIG one that I would like.  I want to log ALL output
114*0061c6a5Schristosfrom command lines into a file for each line.  Thus I might have a chance
115*0061c6a5Schristosof finding out why my crontab entry did not work.
116*0061c6a5Schristos  This would seem to work best if done by cron, as it is now I have a google
117*0061c6a5Schristosof shell scripts laying about just to put the error output where I can see
118*0061c6a5Schristosit.
119*0061c6a5Schristos
120*0061c6a5Schristos<<	My cron (and the SysV cron) will send mail to the owner of the
121*0061c6a5Schristos	particular crontab file if a command generates any output on stdout
122*0061c6a5Schristos	or stderr.  This can be irritating, but if you write a script such
123*0061c6a5Schristos	that any output means a problem occurred, you can avoid most logfile
124*0061c6a5Schristos	needs, and not generate mail except in unforeseen circumstances.   >>
125*0061c6a5Schristos
126*0061c6a5SchristosFrom ptsfa!dual!ucbvax!ihnp4!anvil!es!Robert_Toxen Mon Jan  5 13:08:46 1987
127*0061c6a5SchristosFrom: dual!ucbvax!ihnp4!anvil!es!Robert_Toxen
128*0061c6a5SchristosDate: Fri,  2 Jan 87 14:25:29 EST
129*0061c6a5SchristosTo: anvil!ihnp4!ucbvax!dual!ptsfa!vixie!paul
130*0061c6a5SchristosStatus: RO
131*0061c6a5Schristos
132*0061c6a5SchristosHere are some suggestions:
133*0061c6a5Schristos1. Run it through the C preprocessor via "/lib/<whatever>".
134*0061c6a5Schristos
135*0061c6a5Schristos<<	hmmm. this seems of limited utility, and if you really wanted
136*0061c6a5Schristos	to do it that way, you could do it yourself (since users can
137*0061c6a5Schristos	write to their own crontab files).  I'll add '-' (read stdin)
138*0061c6a5Schristos	to the crontab installer program to facilitate this.		>>
139*0061c6a5Schristos
140*0061c6a5Schristos2. Allow specifying every Nth day of week, i.e., every second Wednesday.
141*0061c6a5Schristos   I did this to calendar by separating the day of week (Wed=4, which one
142*0061c6a5Schristos   to start on and N with slashes).  I took modulo the day of year as a
143*0061c6a5Schristos   starting point so that someone with a desk calendar documenting such
144*0061c6a5Schristos   things can easily determine the offset (second number).  I did this
145*0061c6a5Schristos   while at SGI; alas I don't have a copy of the code.
146*0061c6a5Schristos
147*0061c6a5Schristos<<	I can see how this could be useful, but I'm not sure how I'd
148*0061c6a5Schristos	implement it.  Cron currently doesn't keep track of the last time
149*0061c6a5Schristos	a given command was run; whether the current Wednesday is the first
150*0061c6a5Schristos	or second since the command was last run would be pretty hard to
151*0061c6a5Schristos	figure out.  I'd have to keep a database of commands and their
152*0061c6a5Schristos	execution around, and purge it when the crontab was overwritten.
153*0061c6a5Schristos	This is too much work for me, but if someone adds it, let me know.  >>
154*0061c6a5Schristos
155*0061c6a5SchristosFrom ptsfa!ames!seismo!cbmvax!devon!paul Tue Jan  6 05:50:17 1987
156*0061c6a5SchristosFrom: ames!seismo!cbmvax!devon!paul
157*0061c6a5SchristosTo: cbmvax!seismo!nike!ptsfa!vixie!paul
158*0061c6a5SchristosDate: Mon Jan  5 09:29:57 1987
159*0061c6a5SchristosStatus: RO
160*0061c6a5Schristos
161*0061c6a5SchristosOne problem that has always plagued me with cron is the assumed ORing.
162*0061c6a5SchristosI'd like to see some type of ANDing implemented.  I guess I can best
163*0061c6a5Schristosdescribe this by example.  Say I have the following line in my crontab
164*0061c6a5Schristosfile:
165*0061c6a5Schristos
166*0061c6a5Schristos*  *  4-31  *  1-6	/usr/bin/command
167*0061c6a5Schristos
168*0061c6a5SchristosWhat this does is run 'command' on the 4th thru 31st days of the
169*0061c6a5Schristosmonth, AND on Monday thru Saturday; which probably means running it
170*0061c6a5Schristosevery day of the month (unless Sunday falls on days 1-3).  This
171*0061c6a5Schristoshappens because cron runs the command if the day-of-month OR the
172*0061c6a5Schristosday-of-week is true.
173*0061c6a5Schristos
174*0061c6a5SchristosWhat I'd like to happen with the above line is to run the command ONLY
175*0061c6a5Schristoson Monday thru Saturday any time after the 3rd of the month, e.g. if
176*0061c6a5Schristosthe day-of-month AND the day-of-week are true.
177*0061c6a5Schristos
178*0061c6a5SchristosMy proposal to you is to implement some special chars for the first
179*0061c6a5Schristosfive fields.  Examples:
180*0061c6a5Schristos
181*0061c6a5Schristos*  *  !1-3  *  1-6	/usr/bin/command
182*0061c6a5Schristos
183*0061c6a5Schristos(run command Mon-Sat, but NOT [!] on the first 3 days of the month)
184*0061c6a5Schristos
185*0061c6a5Schristos*  *  &4-31 *  &1-6	/usr/bin/command
186*0061c6a5Schristos
187*0061c6a5Schristos(run command if day-of-month AND day-of-week are true)
188*0061c6a5Schristos
189*0061c6a5SchristosGet the picture?  This would be compatable with existing versions of
190*0061c6a5Schristoscron (which wouldn't currently be using any special characters, so
191*0061c6a5Schristosthat old crontabs would be handled correctly).
192*0061c6a5Schristos
193*0061c6a5Schristos<<	This message made me aware of the actual boolean expression involved
194*0061c6a5Schristos	in a crontab entry.  I'd assumed that it was
195*0061c6a5Schristos		(minute && hour && DoM && month && DoW)
196*0061c6a5Schristos	But it's really
197*0061c6a5Schristos		(minute && hour && month && (DoM || DoW))
198*0061c6a5Schristos
199*0061c6a5Schristos	I can see some value in changing this, but with a fixed order of
200*0061c6a5Schristos	fields, operators get to be kindof unary, which && and || really
201*0061c6a5Schristos	aren't.  If someone has an idea on a syntax that allows useful
202*0061c6a5Schristos	variations to the standard (&& && && (||)) default, please suggest. >>
203*0061c6a5Schristos
204*0061c6a5SchristosFrom bobkat!pedz Tue Jan  6 20:02:10 1987
205*0061c6a5SchristosFrom: pedz@bobkat.UUCP (Pedz Thing)
206*0061c6a5SchristosDate: 2 Jan 87 17:34:44 GMT
207*0061c6a5SchristosStatus: RO
208*0061c6a5Schristos
209*0061c6a5SchristosLog files!  It would be nice to be able to specify a log for cron
210*0061c6a5Schristositself and also a log for each program's stdout and stderr to go to.
211*0061c6a5SchristosThe latter can of course be done with > and 2> but it would be nice if
212*0061c6a5Schristosthere could be a single line with some sort of pattern like
213*0061c6a5Schristos`> /usr/spool/log/%' and the command would be substituted for the %.
214*0061c6a5SchristosAnother thing which would be nice is to be able to specify which shell
215*0061c6a5Schristosto call to give the command to.
216*0061c6a5Schristos
217*0061c6a5Schristos<<	Log files are done with mail.  The '%' idea could be useful if
218*0061c6a5Schristos	a different character were used (% is special to cron, see man
219*0061c6a5Schristos	page); a different directory would have to be chosen, since each
220*0061c6a5Schristos	user has their own crontab file; and something intelligent would
221*0061c6a5Schristos	have to be done in the file naming, since the first word of the
222*0061c6a5Schristos	command might be ambiguous (with other commands).  In short, it's
223*0061c6a5Schristos	too much work.  Sorry.						  >>
224*0061c6a5Schristos
225*0061c6a5SchristosFrom guy%gorodish@sun Tue Jan  6 20:03:13 1987
226*0061c6a5SchristosFrom: guy%gorodish@sun (Guy Harris)
227*0061c6a5SchristosMessage-ID: <10944@sun.uucp>
228*0061c6a5SchristosDate: 5 Jan 87 12:09:09 GMT
229*0061c6a5SchristosReferences: <429@vixie.UUCP> <359@bobkat.UUCP>
230*0061c6a5SchristosSender: news@sun.uucp
231*0061c6a5SchristosStatus: RO
232*0061c6a5Schristos
233*0061c6a5Schristos> Another thing which would be nice is to be able to specify which shell
234*0061c6a5Schristos> to call to give the command to.
235*0061c6a5Schristos
236*0061c6a5SchristosWell, the obvious choice would be the user's shell, but this wouldn't work
237*0061c6a5Schristosfor accounts like "uucico".
238*0061c6a5Schristos
239*0061c6a5Schristos<<	I use the owning user's shell, and to handle "uucico" I check a
240*0061c6a5Schristos	list of "acceptable shells" (currently compiled in, does anybody
241*0061c6a5Schristos	mind?), substituting a default (compiled in) shell if the user's
242*0061c6a5Schristos	shell isn't on the list.
243*0061c6a5Schristos
244*0061c6a5Schristos	BTW, "compiled in" means that it's in a .h file, easily changed
245*0061c6a5Schristos	during installation, but requiring recompilation to modify.  You
246*0061c6a5Schristos	don't have to go digging through the code to find it...		  >>
247*0061c6a5Schristos
248*0061c6a5SchristosFrom qantel!hplabs!ucbvax!mwm@violet.berkeley.edu Tue Jan  6 21:24:48 1987
249*0061c6a5SchristosTo: hplabs!qantel!vixie!paul (Paul Vixie Esq)
250*0061c6a5SchristosDate: 04 Jan 87 00:42:35 PST (Sun)
251*0061c6a5SchristosFrom: Mike Meyer <mwm@violet.berkeley.edu>
252*0061c6a5SchristosStatus: RO
253*0061c6a5Schristos
254*0061c6a5Schristos<<[Discussion of RMS/FSF, and mwm's GNU Cron deleted]>>
255*0061c6a5Schristos
256*0061c6a5SchristosOh, yeah - here are the extensions on my cron:
257*0061c6a5Schristos
258*0061c6a5Schristos1) Sunday is both day 0 and day 7, so it complies with both SysV and
259*0061c6a5SchristosBSD cron.
260*0061c6a5Schristos
261*0061c6a5Schristos<<	Good idea. I did it too, thanks for informing me.	>>
262*0061c6a5Schristos
263*0061c6a5Schristos2) At is integrated into the cron. Instead of atrun to scan the
264*0061c6a5Schristos/usr/spool/at directory, at files are put into the /usr/lib/cron
265*0061c6a5Schristosdirectory along with users cron files, and cron fabricates a line from
266*0061c6a5Schristosa crontab file to run them. This is considered a major win by all who
267*0061c6a5Schristosuse it.
268*0061c6a5Schristos
269*0061c6a5Schristos<<	I don't use 'at', and my cron doesn't do anything with it.  To run
270*0061c6a5Schristos	'at', I use 'atrun' the same way the current BSD cron does.  My
271*0061c6a5Schristos	crontab files are in /usr/spool/cron/crontabs, in the SysV
272*0061c6a5Schristos	tradition -- not in /usr/lib/cron.  This is a configuration
273*0061c6a5Schristos	parameter, of course.						>>
274*0061c6a5Schristos
275*0061c6a5SchristosThere are two known restrictions:
276*0061c6a5Schristos
277*0061c6a5Schristos1) I don't support any of the SysV security hooks. I don't have a use
278*0061c6a5Schristosfor them, and RMS didn't like the idea at all :-).
279*0061c6a5Schristos
280*0061c6a5Schristos<<	This means cron.allow and cron.deny.  I plan to support them, as
281*0061c6a5Schristos	they've been quite helpful at various HPUX sites I've administered. >>
282*0061c6a5Schristos
283*0061c6a5Schristos2) Cron expects to be able to create files with names longer than 14
284*0061c6a5Schristoscharacters, which makes it hard to run on SysV. At least one person
285*0061c6a5Schristoswas working on a port, but I don't know how it's going. That might
286*0061c6a5Schristosmake for a good reason for releasing yours, right there.
287*0061c6a5Schristos
288*0061c6a5Schristos<<	If someone has SysV (with the 14-character limit), they probably
289*0061c6a5Schristos	won't want my cron, since it doesn't add much to the standard
290*0061c6a5Schristos	version (which they may have support for).  My cron is not currently
291*0061c6a5Schristos	portable to non-BSD systems, since it relies on interval timers (I
292*0061c6a5Schristos	needed to sleep for intervals more granular than seconds alone would
293*0061c6a5Schristos	allow).  The port would be trivial, and I will do it if a lot of
294*0061c6a5Schristos	people ask for it...						>>
295*0061c6a5Schristos
296*0061c6a5SchristosOh, yeah - I'm going to see about getting this cron integrated into
297*0061c6a5Schristosthe next 4BSD release.
298*0061c6a5Schristos
299*0061c6a5Schristos<<	How does one go about this?  I have a few nifty gadgets I'd like
300*0061c6a5Schristos	to contribute, this cron being one of them...			>>
301*0061c6a5Schristos
302*0061c6a5Schristos<<[more FSF/GNU discussion deleted]>>
303*0061c6a5Schristos
304*0061c6a5SchristosFrom qantel!hplabs!ames!ut-sally!ut-ngp!melpad!bigtex!james Tue Jan  6 21:24:57 1987
305*0061c6a5SchristosPosted-Date: Fri, 2 Jan 87 19:26:16 est
306*0061c6a5SchristosDate: Fri, 2 Jan 87 19:26:16 est
307*0061c6a5SchristosFrom: hplabs!ames!ut-sally!ut-ngp!bigtex!james
308*0061c6a5SchristosTo: vixie!paul
309*0061c6a5SchristosStatus: RO
310*0061c6a5Schristos
311*0061c6a5SchristosYes!!!  There are several critical failures in System V cron...
312*0061c6a5Schristos
313*0061c6a5Schristos1. Pass all variables in cron's environment into the environment of things
314*0061c6a5Schristos   cron starts up, or at least into the crontab entries started up (at jobs
315*0061c6a5Schristos   will inherit the environment of the user).  If nothing else it is critically
316*0061c6a5Schristos   important that the TZ variable be passed on.  PATH should be passed on too.
317*0061c6a5Schristos   Basically, passing environment values allows one to design a standard
318*0061c6a5Schristos   environment with TZ and PATH and have that run by everything.  If anyone
319*0061c6a5Schristos   tells you this is no big deal, consider what happens when uucico is
320*0061c6a5Schristos   started by cron in CA to make a long distance phone link...  Unless the
321*0061c6a5Schristos   administrator is really on his/her toes, calls scheduled at 5pm will really
322*0061c6a5Schristos   go at two in the afternoon, needlessly incurring huge phone bills, all
323*0061c6a5Schristos   because System V refuses to pass the TZ from its environment down.  There
324*0061c6a5Schristos   are work arounds, but only putting it in cron will really work.  This is
325*0061c6a5Schristos   not a security hole.
326*0061c6a5Schristos
327*0061c6a5Schristos<<	delete TERM and TERMCAP; modify HOME, USER, and CWD; pass TZ and
328*0061c6a5Schristos	PATH through undisturbed.  any other requests out there?
329*0061c6a5Schristos
330*0061c6a5Schristos	BSD doesn't have this problem -- TZ is passed right on through if
331*0061c6a5Schristos	you define it in the shell before starting my cron daemon.  However,
332*0061c6a5Schristos	the BSD I'm running this on doesn't need TZ to be defined anyway...
333*0061c6a5Schristos	The default in the kernel has been just fine so far...  But just the
334*0061c6a5Schristos	same, if/when I port to SysV (I guess I really should), I'll make
335*0061c6a5Schristos	sure this works right.
336*0061c6a5Schristos
337*0061c6a5Schristos	I guess I've been spoiled.  HPUX is SysV-based, and I never had a
338*0061c6a5Schristos	problem with cron and TZ when I used it.			  >>
339*0061c6a5Schristos
340*0061c6a5Schristos2. A way to avoid logging stuff in /usr/lib/cron/log.  I have a cron entry
341*0061c6a5Schristos   run uudemon.hr every 10 minutes.  This is 144 times/day.  Each run generates
342*0061c6a5Schristos   three lines of text, for a total of 432 lines of text I don't want to see.
343*0061c6a5Schristos   Obviously this should be optional, but it would be nice if there were a
344*0061c6a5Schristos   way to flag an entry so that it wasn't logged at all unless there was an
345*0061c6a5Schristos   error.
346*0061c6a5Schristos
347*0061c6a5Schristos<<	I don't know nothin' 'bout no /usr/lib/cron/log.  What is this file?
348*0061c6a5Schristos	I don't see any reason to create log entries, given the mail-the-
349*0061c6a5Schristos	output behaviour.  Opinions, anyone?				>>
350*0061c6a5Schristos
351*0061c6a5SchristosI will come up with other ideas no doubt, but I can always implement them
352*0061c6a5Schristosmyself.
353*0061c6a5Schristos
354*0061c6a5Schristos<<	That's what I like about PD software.  Please send me the diffs!  >>
355*0061c6a5Schristos
356*0061c6a5SchristosThe other problem you have is making sure you can run standard
357*0061c6a5Schristoscrontabs.  I would suggest something like this: if the command part of the
358*0061c6a5Schristosentry starts with an unescaped -, then flags and options follow immediately
359*0061c6a5Schristosthereafter.  As in:
360*0061c6a5Schristos
361*0061c6a5Schristos2,12,22,32,42,52 * * * * -q /usr/lib/uucp/uudemon.hr
362*0061c6a5Schristos
363*0061c6a5SchristosThis could mean do not log the uudemon.hr run unless there is a problem of
364*0061c6a5Schristossome kind.  This is probably safe as not many filenames start with "-", and
365*0061c6a5Schristosthose that do are already a problem for people.
366*0061c6a5Schristos
367*0061c6a5Schristos<<	Since I don't plan on supporting /usr/lib/cron/log in ANY form unless
368*0061c6a5Schristos	many people request it, I won't be needing -q as you've defined it.
369*0061c6a5Schristos	I could use something like this to avoid sending mail on errors, for
370*0061c6a5Schristos	the occasional script that you don't want to bullet-proof.
371*0061c6a5Schristos
372*0061c6a5Schristos	The compatibility issue is CRITICAL.  The 4.3BSD crontab format is
373*0061c6a5Schristos	a crime against the whole philosophy of Unix(TM), in my opinion.   >>
374*0061c6a5Schristos
375*0061c6a5SchristosOne other minor thing to consider is the ulimit: can different users get
376*0061c6a5Schristosdifferent ulimits for their crontab entries?
377*0061c6a5Schristos
378*0061c6a5Schristos<<	Boy I'm ignorant today.  What's a ulimit, and what should I do with
379*0061c6a5Schristos	it in a crontab?  Suggestions, enlightenment, etc ??		   >>
380*0061c6a5Schristos
381*0061c6a5SchristosFrom qantel!lll-crg!ames!uw-beaver!uw-nsr!john Tue Jan  6 23:32:44 1987
382*0061c6a5SchristosDate: Thu, 1 Jan 87 10:53:05 pst
383*0061c6a5SchristosFrom: lll-crg!ames!uw-beaver!uw-nsr!john (John Sambrook 5-7433)
384*0061c6a5SchristosTo: vixie!paul
385*0061c6a5SchristosStatus: RO
386*0061c6a5Schristos
387*0061c6a5SchristosHow about not hardwiring the default environment that cron builds for its
388*0061c6a5Schristoschildren in the cron program itself?  Our cron does this and it's the pits
389*0061c6a5Schristosbecause we are TZ=PST8PDT not TZ=EST5EDT !
390*0061c6a5Schristos
391*0061c6a5Schristos<<	yeachk.  I assure you, I will not hardwire the TZ!		>>
392*0061c6a5SchristosFrom ptsfa!well!dv Fri Jan  9 04:01:50 1987
393*0061c6a5SchristosDate: Thu, 8 Jan 87 23:50:40 pst
394*0061c6a5SchristosFrom: well!dv (David W. Vezie)
395*0061c6a5SchristosTo: ptsfa!vixie!paul
396*0061c6a5SchristosStatus: RO
397*0061c6a5Schristos
398*0061c6a5Schristos6, have a special notation called 'H' which would expand to weekends
399*0061c6a5Schristos   and holidays (you'd have to keep a database somewhere of real
400*0061c6a5Schristos   holidays), and also 'W' for workdays (neither weekend or holiday).
401*0061c6a5Schristos
402*0061c6a5Schristos<<	Too much work.  There should be a standard way to define and
403*0061c6a5Schristos	detect holidays under Unix(TM); if there were, I'd use it.  As
404*0061c6a5Schristos	it is, I'll leave this for someone else to add.
405*0061c6a5Schristos
406*0061c6a5Schristos	I can see the usefulness; it just doesn't quite seem worth it.    >>
407*0061c6a5SchristosFrom qantel!gatech!akgua!blnt1!jat Wed Jan 14 20:00:40 1987
408*0061c6a5SchristosDate: Tue, 13 Jan 87 16:39:38 EST
409*0061c6a5SchristosFrom: gatech!akgua!blnt1!jat
410*0061c6a5SchristosStatus: RO
411*0061c6a5Schristos
412*0061c6a5Schristos1) Add some way to tell cron to reread the files, say kill -1 <pid>
413*0061c6a5Schristos
414*0061c6a5Schristos<<	whenever the 'crontab' program is run and updates a crontab file,
415*0061c6a5Schristos	a file /usr/spool/cron/POKECRON is created; next time the cron
416*0061c6a5Schristos	daemon wakes up, it sees it, and re-reads the crontab files.
417*0061c6a5Schristos
418*0061c6a5Schristos	I thought of handling the signal; even implemented it.  Then this
419*0061c6a5Schristos	clever idea hit me and I ripped it all out and added a single
420*0061c6a5Schristos	IF-statement to handle the POKECRON file.			>>
421*0061c6a5Schristos
422*0061c6a5Schristos2) Have some kind of retry time so that if a command fails, cron will try to
423*0061c6a5Schristos   execute it again after a certain period.  This is useful if you have some
424*0061c6a5Schristos   type of cleanup program that can run at the scheduled time for some reason
425*0061c6a5Schristos   (such as locked device, unmounted filesystem, etc).
426*0061c6a5Schristos
427*0061c6a5Schristos<<	Hmmm, sounds useful.  I could do this by submitting an 'at' job...
428*0061c6a5Schristos	I'll think about it.						>>
429*0061c6a5SchristosFrom ptsfa!dual!ucbvax!ihnp4!mtuxo!ender Sat Jan  3 16:54:00 1987
430*0061c6a5SchristosFrom: dual!ucbvax!ihnp4!mtuxo!ender
431*0061c6a5SchristosDate: Sat, 3 Jan 87 14:05:13 PST
432*0061c6a5SchristosTo: ucbvax!dual!ptsfa!vixie!paul
433*0061c6a5SchristosStatus: RO
434*0061c6a5Schristos
435*0061c6a5SchristosIt would be nice if nonprivileged users can setup personal crontab files
436*0061c6a5Schristos(~/.cronrc, say) and be able to run personal jobs at regular intervals.
437*0061c6a5Schristos
438*0061c6a5Schristos<<	this is done, but in the SysV style: the 'crontab' program installs
439*0061c6a5Schristos	a new crontab file for the executing user (can be overridden by root
440*0061c6a5Schristos	for setup of uucp and news).  the advantage of this is that (1) when
441*0061c6a5Schristos	a crontab is changed, the daemon can be informed automatically; and
442*0061c6a5Schristos	(2) the file can be syntax-checked before installation.		>>
443*0061c6a5SchristosFrom ptsfa!ames!seismo!ihnp4!lcc!richard Fri Jan 16 04:47:33 1987
444*0061c6a5SchristosDate: Fri, 16 Jan 87 07:44:57 EST
445*0061c6a5SchristosTo: nike!ptsfa!vixie!paul
446*0061c6a5SchristosStatus: RO
447*0061c6a5Schristos
448*0061c6a5SchristosThe System V cron is nice, but it has a few annoying features.  One is that
449*0061c6a5Schristosits mail files will say that the previous message is the output of "one of your
450*0061c6a5Schristoscron commands."  I wish it would say WHICH cron commmand.
451*0061c6a5Schristos
452*0061c6a5Schristos<<	Done.  Also which shell, which user (useful when the mail gets
453*0061c6a5Schristos	forwarded), which home directory, and other useful crud.	>>
454*0061c6a5Schristos
455*0061c6a5SchristosAnother problem is with timezones.  It is necessary to specify TZ=PST8PDT (or
456*0061c6a5Schristoswhatever) when you invoke cron (from inittab, or /etc/rc) and it is also
457*0061c6a5Schristosnecessary to add TZ=PST8PDT to each crontab line which might need it.  Cron
458*0061c6a5Schristosshould automatically export its idea of the "TZ" to each invoked command, and
459*0061c6a5Schristosit should be possible to put a line in the crontab file which overrides that
460*0061c6a5Schristosfor every command in the file (e.g., most users are on EST, so cron is run
461*0061c6a5Schristoswith TZ=EST5EDT; but one user is usually on PST and wants all of his cron
462*0061c6a5Schristoscommands to run with TZ=PST8PDT).  This might be extended to allow any
463*0061c6a5Schristosenvironment variable to be specified once for the whole crontab file (e.g.,
464*0061c6a5SchristosPATH).
465*0061c6a5Schristos
466*0061c6a5Schristos<<	Well, since I run the user's shell, you could put this into .cshrc.
467*0061c6a5Schristos	generic environment-variable setting could be useful, though.  Since
468*0061c6a5Schristos	I have to modify the environment anyway, I'll consider this.	  >>
469*0061c6a5Schristos
470*0061c6a5SchristosA log file might be a nice idea, but the System V cron log is too verbose.
471*0061c6a5SchristosI seem to remember that cron keeps it open, too; so you can't even have
472*0061c6a5Schristossomething go and periodically clean it out.
473*0061c6a5Schristos
474*0061c6a5Schristos<<	I don't do /usr/lib/cron/log.  I wasn't aware of this file until I
475*0061c6a5Schristos	got all these suggestions.  Do people want this file?  Tell me!    >>
476