crontab: Sunday=7, not 0.

Guy Harris guy at sun.uucp
Sun Oct 27 09:59:17 AEST 1985


> >> By the way, the man page for cron(8) lies.  It says that the
> >> days are numbered 1-7 with 1=Monday.  The days are actually
> >> numbered 0-6 with 0=Sunday.
> >
> >I tried it on my Sun and he is incorrect.  On a Sunday, I added two
> >entries, one for day 7 and one for day 0, at the same time (a few minutes
> >hence).  The one with day 7 ran, with day 0 didn't.  QED.
> 
> Sunday is 0 on my system (still 4.1 BSD, sigh).

I believe the V7 man page lied; it said the days went 1-7 with 1=Monday,
when the actually went 0-6 with 0-Sunday.  The USG/USDL (people who brought
you S3/S5) fixed the man page.  The CSRG at UCB (people who brought you
4.xBSD) fixed the *code* in 4.2.  They should have known better - if UNIX
code and UNIX documentation disagree, 99 times out of 100 (if not more
often), the documentation is wrong.  Thus, 4.2BSD's "cron" is out of sync
with every other "cron" out there.  Sigh.  (Admittedly, the S5R2 "cron" is
also somewhat different; "crontab"s have the same format, but they live in
different places and every user gets one of their own, to have, hold, and
alter.)

	Guy Harris



More information about the Comp.unix mailing list