1 |
On 19/09/2014 06:21, Joseph wrote: |
2 |
> On 09/18/14 19:14, Alan McKinnon wrote: |
3 |
>> On 18/09/2014 18:44, Joseph wrote: |
4 |
>>> I want to run a cron job only once a month. The problem is the computer |
5 |
>>> is only on on weekdays Mon-Fri. 1-5 |
6 |
>>> |
7 |
>>> cron tab as this below is an "or" condition as it has entries in Days of |
8 |
>>> the Months and Day of the Week |
9 |
>>> |
10 |
>>> 5 18 1 * 2 rsync -av ... |
11 |
>>> |
12 |
>>> so it will run on days 1 or Tuesday of each months. |
13 |
>>> |
14 |
>>> Is it possible to create "and" condition, eg. run it on Tuesday between |
15 |
>>> days 1 to 7; depend on which day Tuesday falls on? |
16 |
>> |
17 |
>> |
18 |
>> Not in one line. |
19 |
>> |
20 |
>> Split it into two crontab entries. |
21 |
> |
22 |
> Interesting. How do you split cron job? I couldn't find any examples. |
23 |
> |
24 |
|
25 |
|
26 |
No wait, that won't work. What you want to accomplish cannot be done |
27 |
with a single crontab job. |
28 |
|
29 |
Use periodic/monthly like the other poster said or use anacron so the |
30 |
job will run when the machine is next powered on. |
31 |
|
32 |
|
33 |
-- |
34 |
Alan McKinnon |
35 |
alan.mckinnon@×××××.com |