On Mon, 09 Jan 2012 13:10:50 +0100 Daniel Troeder <[email protected]> wrote:
> Hi :) > > It seems I don't understand something about cron(tab). Can someone > help me pls: > > I want to run flexbackup with the following backup plan: > * monthly full > * weekly diff > * daily incr > > So I have installed sys-process/vixie-cron-4.1-r12 (and virtual/cron-0 > and sys-process/cronbase-0.3.3). > > My crontab (created with "crontab -e") contains: > > 00 03 2-31 * 1-6 /usr/bin/flexbackup -set root -level incremental > 00 03 2-31 * 0 /usr/bin/flexbackup -set root -level differential > 00 03 1 * * /usr/bin/flexbackup -set root -level full > > The problem I'm facing is, that incr and diff are executed each day > _both_ at the same time (which flexbackup luckily handles well). > > From my understanding the 2nd line (diff) should only be run on > sundays, and the 1st line (inc) should not run sundays. > > > Can someone please explain me what I'm doing wrong? You are combining fields 3 and 5, those two work funny. Unlike the other datetime specs, they are not ANDed, they are ORed. Taking the first one, you obviously want the cron to run at 3 am between the 2nd and 31st of the month AND if the day is Mon-Sat. What it is doing is running at 3am every day between the 2nd and 31st and also every day Mon-Sat (even if that is the 1st of the month). Vixie cron does not directly allow you to do what you want. It's designed to run things periodically on a set schedule and doesn't do "except" very well. A better approach would be to fire off a wrapper script every day at 3am. This script will then check for date, time and day of week and launch the app with the appropriate options. > > Thank you, > Daniel > -- Alan McKinnnon [email protected]

