Equivalent "keep" rule to Duplicati's smart backup retention?

Hey all,

I’m working on migrating to Duplicacy from Duplicati and I was a little unclear about the keep rules for backup pruning. I’m trying to imitate Duplicati’s “smart backup retention” setting which keeps 1 daily backup for each of the last 7 days, 1 weekly backup for each of the last 4 weeks, and 1 monthly backup for each of the last 12 months, while always retaining at least one backup. Following the HOWTO guides I’ve come up with something like this in duplicati-util:

keep: "0:365 30:30 7:7 1:1"

Is this correct for what I’m trying to accomplish?

Thanks!

Yes, but remember each keep statement requires its own flag, so your prune rules would look like:

-keep 0:365 -keep 30:30 -keep 7:7 -keep 1:1

And just to help you think about the rules in human readable form, your rules look like this

  • keep no snapshots older than 1 year
  • keep one snapshot every 30 days (monthly-ish) for any snapshot older than 30 days, but younger than a year
  • keep one snapshot every week for snapshots older than a week, but younger than 30 days
  • keep one snapshot every one day (daily) for snapshots older than one day, but younger than a week.
2 Likes

Just one question.

Are you sure that the keep parameters you specified would always keep at least one backup? If I created only one snapshot and a year and a day passed, I think that the prune command will delete this copy. Do I miss something?

So, the way I think it works in Duplicati (and this is how I meant it for Duplicacy as well), is that at least one copy of a file that was previously backed up will remain. So the use-case I’m concerned about is this:

if I back up a file as part of my nightly backups, but I don’t change it for over a year, will Duplicacy keep a backup of it or will it get deleted when the year-old backups get pruned?

If you do not delete the file, it will be in all your backups, including the most recent ones.

If you delete the file, it will only be present until the last backup before deletion. When this backup becomes one year old (and if you have a rule like -keep 0:365 or more restrictive) the backup of the file will be deleted and you will not be able to restore it.

2 Likes

Great, thanks a lot for the clarification!

Keep in mind that, even if you do not delete the file, you will lose versions (or, in Duplicacy language, revisions) of the file older than one year.

Duplicacy does not retain or delete files but snapshots of an entire repository. So there is currently no way of making sure that once a file was backed up it will be backed up for ever (except, of course, if you never delete any old backup). Whether such a feature could be implemented has not been conclusively discussed but according to the developer it is
very hard to implement”.

For the reverse problem (removing a specific file from the storage) see this topic:

See also: Migrating from CrashPlan to Duplicacy