Cron - First Saturday of the month

Randal Schwartz merlyn at iwarp.intel.com
Thu Aug 9 10:18:50 AEST 1990


In article <1990Aug8.214539.1264 at watserv1.waterloo.edu>, dmcanzi at watserv1 (David Canzi) writes:
| Apparently, there is at least one version of cron which has somehow
| escaped your wizardly notice.  Here is what "man 5 crontab" says at
| my site:
| 
|      Note: the specification of days may be made  by  two  fields
|      (day  of the month and day of the week).  If both are speci-
|      fied as a list of elements, both are adhered to.  For  exam-
|      ple,
|           0 0 1,15 * 1
|      would run a command on  the  first  and  fifteenth  of  each
|      month,  as well as on every Monday.
| 

Interesting, but after finishing reading the manpage (I have that
very same manpage on sunos4.1), I notice that it contradicts itself
a little later in saying that

"          0 0 * * 1
"
"    would run a command only on Mondays.

Now wait a second, since "*" says "any match'll do", this command
would run *every* day, not on Mondays, using the "or" logic described
earlier in the previous paragraph.

I submit that the writers of that there manpage just didn't know what
they were talking about.  As a real guru hacking the One True Unix, I
would then curse the manpage author, and go look at the source.
However, since I haven't seen UNIX source (UNIX without source... a
mortal sin) for 5 years (gack!!!), I cannot resolve this by myself.
Help, someone?  Does it really use "or" logic or something even more
strangely convoluted?  Or is it "and" logic, like it was back in V7
(the One True Unix... system V isn't even close).

Yeah, OK, so I'm a bit religious.  (SunOS isn't UNIX either, but at
least it is upward compatible with V7. :-)

Just another old-time UNIX hacker,
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/



More information about the Comp.unix.wizards mailing list