1

I'm trying to setup some backup strategy using anacron and I'm running into a small issue.

I'm using duplicity as a backup utility, which has 2 types of backups: full and incremental. I want a incremental backup to be made every day and a full backup once a month. Is there a way to specify to anacron that I don't wan't my daily backup to run the day my monthly backup runs ?

Setting the daily backup from days 2-31 of the month won't do the trick as this is my work laptop and I might not switch the computer on on the first day of the month (let's say it's a Sunday), in which case anacron will run my full backup script the next day I loggin.

Extra-question: I've read anacron stops if I unplug the AC. Does this mean it will stop the execution of already started scripts ? Let's say I unplug the AC once anacron is already running my backup script, will the backup terminate normally or will it be killed as soon as I unplugged which might result in a corrupted backup ?

1 Answer 1

0

any reason not to let duplicity decide if it is time for a new full?

... enforcing a full every other time via --full-if-older-than <time> , e.g. a full every month:
duplicity --full-if-older-than 1M /home/me sftp://[email protected]/some_dir

btw. this example is actually taken from the duplicity manpage ..ede/duply.net

4
  • This is actually what I'm using now, however it doesn't really fit my need as I'd like to also change the destination directory when doing a full backup. This is why I wanted 2 separate scripts, 1 that will create a new destination and perform a full backup, and 1 that will perform a incremental backup in the current destination directory. Maybe this can also be done directly from duplicity, but we are kind of moving away from the original question there :)
    – Scaum
    Commented Oct 29, 2018 at 8:41
  • yes, sounds more like an anacron question. still, why "Setting the daily backup from days 2-31 of the month won't do the trick ..., in which case anacron will run my full backup script the next day I loggin." does that not fit? Commented Nov 2, 2018 at 8:31
  • wrt. " I'd like to also change the destination directory when doing a full backup" you could utilize the output of date +%Y%m for the given target path. you machine clock should really always have a proper date then. Commented Nov 2, 2018 at 8:43
  • finally.. duplicity is probably best for always on boxes (eg. resuming can fail or have unwanted results). for a sometimes on/sometimes of box i'd suggest to setup remote file access and run the backup on an always on machine preferribly in the same LAN (for speed). not sure that duplicity is needed then, because it's local you can forgo encryption and work eg. with rsync snapshots. these can then be transferred encrypted off-site for add. safety eg. w/ duplicity.. ede/duply.net Commented Nov 2, 2018 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .