PDA

View Full Version : Scheduling a backup on just one day a month


kbradnam
12-01-2005, 06:02 PM
Hi again,

For one of my backups I only want it to run once a month. So yesterday I setup the schedule to copy every 1st week on Sunday at 4:00 am.

When I opened the Schedule window today (to check that other backups had run on time) I noticed that the monthly backup had already run, despite not being Sunday ('Last Copy' entry says Thursday December 1st). The 'Next Copy' part correctly says Sunday December 4th. So I ran 'crontab -l' to see what the crontab file was reporting and the date & time part of the entry says:

0 4 1-7 * 0

I think this is where the problem lies. According to my understanding, cron will run jobs when the time field is matched and *one* of the day/month fields is correct. So I think it will run every Sunday *and* on each of the first seven days of the month.

So I'm not sure if this is something that needs to be dealt with?

Regards,

Keith

dnanian
12-01-2005, 06:08 PM
I've got code in the AppleScript that runs when the crontab fires that's supposed to change the "or" implied in a crontab into an and, Keith, so it should have worked properly: at least, I haven't noticed problems here.

But, that said, "4" isn't "Sunday" -- it's Wednesday, which would make the operation correct. Are you sure you selected "Sunday"?

kbradnam
12-01-2005, 06:21 PM
Just double checked and the schedule is set for Sunday not Wednesday. Let me see if it runs tomorrow or not, and I'll get back to you.

Keith

dnanian
12-01-2005, 06:28 PM
My fault -- I misread the crontab entry you posted, Keith.

kbradnam
12-02-2005, 01:22 PM
Ok, so I checked first thing this morning and my 'monthly' backup had run again. The 'Next Copy' field is still unchanged saying Sunday December 4th.

I'd wager that this backup will run each day until the 8th and then stop again until the first.

Any thoughts on whether you think this is a glitch at my end with something that I've done wrong, or a glitch in your applescript that changes the cron 'or' functionality into an 'and'.

If you like, I'm prepared to let this backup run for another week to test my hypothesis :-)

Regards,

Keith

dnanian
12-02-2005, 01:36 PM
Instead, set up a single scheduled item for sunday at about three minutes from now, just like the other one. Does it mysteriously run?

If so, please send your Crontab contents to the support address. I'd like to see what I can see in there, maybe there's a weird case I'm not handling in the script.

kbradnam
12-02-2005, 01:55 PM
Good idea Dave (much smarter than my idea!).

I just tried this and lo and behold the backup started even though I specified to only run on the 1st Sunday. I'll email the offending crontab entry to you.

Regards,

Keith

dnanian
12-02-2005, 03:47 PM
Cool, Keith -- thanks.

dnanian
12-02-2005, 05:49 PM
OK. I'm pretty sure I know what's going on here, and -- if you're running into it -- here's how to fix:


Navigate to the SuperDuper! application
Control-click it and choose "Show Package Contents"
In there, navigate to Contents/Resources
Replace the "Copy Job Script.template" file in there with the one attached to this message (unzip first)
Delete and reschedule your jobs


This fix will be in 2.0.2, when released.