Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!wb3ffv!fallst!tkevans From: tkevans@fallst.UUCP (Tim Evans) Newsgroups: comp.unix.wizards Subject: Re: Cron - First Saturday of the month Message-ID: <1701@fallst.UUCP> Date: 18 Aug 90 14:32:55 GMT References: <19744@orstcs.CS.ORST.EDU> <19137@ttidca.TTI.COM> Organization: Fallston, MD Lines: 42 In <19137@ttidca.TTI.COM> alter@ttidca.TTI.COM (Steve Alter) writes: >In article <19744@orstcs.CS.ORST.EDU> curt@oce.orst.edu (Curt Vandetta) writes: >} I'm wondering if anyone has a way of making cron run a job on the >} first Saturday of every month? >I'm going to totally side-step the fight that has been waged over >whether the day-of-week is logically ANDed or ORed with the day-of-month. >You can set it up using a combination of cron and "at". You can also let the job itself figure out what day it is and decide whether to run. The following fragment is from a script which is run _every_ Wednesday on my system; depending on the day of the month, it does different things. (Specifically, on the 2nd Wednesday of the month, it does one thing, on the 3rd Wednesday, it does something else, and on all other Wednesdays, it does nothing.) # extract 3rd field of output from date command set `date` TODAY=$3 case "$TODAY" in 8|9|10|11|12|13|14) # it's the 2nd Wednesday; send reminder echo "FOO DISTRIBUTION NEXT WEEK ------------------------------ This is to remind you that the regular monthly distribution of foo will take place next Wednesday. If you have any corrections/updates, please send your updates no later than close of business Friday. If you have any questions, please contact so-and-so" | mail aliaslist;; # it's the 3rd Wednesday; do it! 15|16|17|18|19|20|21) DistMachDb;; # call shell function to do distribution # it's any Wednesday other than 2nd or 3rd, so just quit *) exit 0;; esac -- UUCP: {rutgers|ames|uunet}!mimsy!woodb!fallst!tkevans INTERNET: tkevans%fallst@wb3ffv.ampr.org Tim Evans 2201 Brookhaven Ct, Fallston, MD 21047