[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Crontab syntax question



Cron doesn't seem to be able to do and so you could try the following hack

0 8 1-7 * * if  [ `date +%u` -eq 5 ]; then echo first friday;fi

should work (in theory :-)

Chris

Quoting Pramod Korathota <bug@nospam.progsoc.uts.edu.au>:

> Hi all,
> 
> A quick question on crontab syntax.. I need to run a 
> command on the first friday of every month. I've gone
> through the crontab(8) and crontab(5) man pages,
> but the best I've got to is :
> 
> 0 8 1-7	* 5 <user> <command>
> 
> Which seems to do a logical OR and execute the
> command on the first seven days as well as on
> friday..
> 
> Is there a way to make that into a logical AND
> so I can get it to do what I want (or is there
> a different syntax for what I need?)
> 
> Any help would be greatly appreciated. :)
> 
> Pramod,
> 
> 
> -- 
> Pramod Korathota <bug@nospam.progsoc.uts.edu.au>
> 
> "Engineers never lie; we just approximate the truth."
> 
> 
> -
> You are subscribed to the progsoc mailing list. To unsubscribe, send a
> message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
> If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for
> help.
> 
-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.