Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.unix.wizards Subject: Re: Cron - First Saturday of the month Message-ID: <9155@jpl-devvax.JPL.NASA.GOV> Date: 15 Aug 90 23:14:42 GMT References: <1990Aug8.185745.16606@iwarp.intel.com> <1990Aug11.030818.28876@watserv1.waterloo.edu> <3706@aspect.UUCP> <1489@hagbard.dc.luth.se> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 17 In article <1489@hagbard.dc.luth.se> bj@dc.luth.se (B|rje Josefsson) writes: : Slightly a side question according to the Subject:, but how to setup a : command for execution on the LAST day of the month ONLY? : : I could use: : 0 0 31 1 * command : 0 0 28 2 * command : 0 0 31 3 * command : and so on : but that will not work on leap years... I'd suggest (surprise, surprise) 0 0 * * * perl -e '(localtime(time + 24*60*60))[3] == 1 && exec "command"' or, more concisely 0 0 * * * perl -e 'exit+(localtime time+86400)[3]-1' && command Larry Wall lwall@jpl-devvax.jpl.nasa.gov