On 19/09/2014 06:21, Joseph wrote: > On 09/18/14 19:14, Alan McKinnon wrote: >> On 18/09/2014 18:44, Joseph wrote: >>> I want to run a cron job only once a month. The problem is the computer >>> is only on on weekdays Mon-Fri. 1-5 >>> >>> cron tab as this below is an "or" condition as it has entries in Days of >>> the Months and Day of the Week >>> >>> 5 18 1 * 2 rsync -av ... >>> >>> so it will run on days 1 or Tuesday of each months. >>> >>> Is it possible to create "and" condition, eg. run it on Tuesday between >>> days 1 to 7; depend on which day Tuesday falls on? >> >> >> Not in one line. >> >> Split it into two crontab entries. > > Interesting. How do you split cron job? I couldn't find any examples. >
No wait, that won't work. What you want to accomplish cannot be done with a single crontab job. Use periodic/monthly like the other poster said or use anacron so the job will run when the machine is next powered on. -- Alan McKinnon alan.mckin...@gmail.com