Cron - First Saturday of the month

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Fri Aug 10 12:40:29 AEST 1990


In article <1990Aug8.185745.16606 at iwarp.intel.com> merlyn at iwarp.intel.com (Randal Schwartz) writes:
>In article <19744 at orstcs.CS.ORST.EDU>, curt at oce (Curt Vandetta) writes:
>|   I'm wondering if anyone has a way of making cron run a job on the
>|   first Saturday of every month?  
>
>3 4 1-7 * 6 command
>
>to make 'command' run at 4:03am... adjust the first two fields as
>necessary.  Remember, the parameters are "and"-ed together.
...flame deleted

My documentation states that a line like the one you have provided
would cause the command to run on EVERY Saturday as well as on each
of the first seven days in the month.

My flame--

I would be very interested if you could provide a cron only method
of getting my cron to execute on the first Saturday (or any other
day) such that it executes on that single day only.  My attempts at
solving this have been to combine cron to run the command on Saturday
and have command be a script that checks the date to be sure it is
less than or equal to 7.  But this only works for the first 13 days
so I have to figure out the next exclusion, probably to limit between
a start and stop.  In any case, getting cron to do what Curt wants is
a little more difficult.  Possibly (probably, I think) even wizard
caliber.

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.wizards mailing list