Gentoo Archives: gentoo-user

From: Kerin Millar <kerframil@×××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] crontab - "and' condition
Date: Thu, 18 Sep 2014 16:58:07
Message-Id: 541B0F15.6060001@fastmail.co.uk
In Reply to: [gentoo-user] crontab - "and' condition by Joseph
1 On 18/09/2014 17:44, Joseph wrote:
2 > I want to run a cron job only once a month. The problem is the computer
3 > is only on on weekdays Mon-Fri. 1-5
4 >
5 > cron tab as this below is an "or" condition as it has entries in Days of
6 > the Months and Day of the Week
7 >
8 > 5 18 1 * 2 rsync -av ...
9 >
10 > so it will run on days 1 or Tuesday of each months.
11 >
12 > Is it possible to create "and" condition, eg. run it on Tuesday between
13 > days 1 to 7; depend on which day Tuesday falls on?
14
15 You can place a script in /etc/cron.monthly. The run-crons script is
16 scheduled to execute every 10 minutes, and it will ensure that your
17 script is executed on a monthly schedule. This is true of both cronie
18 and vixie-cron.
19
20 --Kerin