On Thu, Nov 15, 2007 at 11:33:35PM -0500, Micah Anderson wrote: > > > > --- Please enter the report below this line. --- > > > > I don't always have my system powered up when backupninja is set to run > > > > my > > > > local rdiff-backup backup. It would be nice if backupninja could use > > > > Anacron, or some Anacron-like logic, so I could specify a frequency > > > > of "daily" or "every 24 hours," and then have backupninja run it if > > > > that much > > > > time has passed since the last backup was run, regardless of what time > > > > it is > > > > at the moment. > > > > The only solution I can think of is to write a cronjob that checks the > timestamp on the backupninja.log file and if its been 24 hours, then > initiate a backup immediately. > SNIP > > If you can come up with a good mechanism, I'm happy to include it, but > from where I am sitting this smacks me as a technical solution to a > non-technical problem. >
Hi. I think I may have found a way to implement this. It will involve setting up : 1. an anacron job that triggers : 1 60 backup.daily backupninja -f /etc/backupninja.conf.anacron -n --run /etc/backup.d/94.rdiff The specific backupninja.conf file is suppressing the colored output un debug mode, and ideally would also unset the debug details : --run sets the debug mode, but that isn't very handy when anacron reports via mail, in particular if backup is successful. As a backup may still be running when anacron triggers it (for instance on AC power returning), the backup may fail because it can't acquire the lock, but this should probably not be reported as a failure in the cron's report mailed to root. This could be improved by using cronic to wrat the execution, and check that the output is different from a non-failing case... I'm starting it 60 minutes after bootup to avoid messing too much with may daily routine, but this could be adjusted. 2. another backup.d special job set to execute after the rdiff backup (following my example), as 94_zzz_01.sh, which will have the same when that the preceding 94.rdiff, and which will set the timestamp of the anacron job, to flag that the cronjob has been started, and anacron doesn't need to care for the rest of that day, by issueing a "anacron -u backup.daily". For instance : #!/bin/sh # 6 minutes after 94.rdiff, we will notify anacron that it shall not run 94 today when = everyday at 22:00 when = everyday at 12:00 sleep 360 # notify anacron that backup.daily doesn't need to run today anacron -u backup.daily I'm not completely sure this is bullet-proof, but somehow, that should ensure that I get backups done every noon or 10PM, or 1 hour after bootup, if I wake up sooner than 11 ;-) This needs to be tested, in particular regarding the error/success reports anacron should send to root by mail... Any remarks/comments much welcome. Best regards, -- Olivier BERGER http://www-public.telecom-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8 Ingenieur Recherche - Dept INF Institut Mines-Telecom, Telecom SudParis, Evry (France) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org