Prune command details

@TheBestPessimist
I need to delete everything that is older than 90 days on my backups. What commands should I be using? This is what i’m currently pruning, but it has not freed space.
[-keep 0:90 -keep 7:30 -keep 3:10 -a]

1 Like

Your command would remove snapshots older than 90 days. Whether this leads to freeing space depends on how many chunks are there that are only used by snapshots older than 90 days. Maybe none. This is highly correlated with your data turnover rate

Imagine if your data set does not change; its a static set of unchanging files – like a photolibrary. Then pruning old snapshots will not free any space, (and making new backups won’t take any new space either).

if by “everything” you refer to files – then it is not possible. Snapshots are immutable, as they should be.

5 Likes

Note also, you won’t free the space those old snapshot take up until the second run of prune, since pruning is done in two steps - collection then delete. A subsequent backup on all your repositories needs to happen before the second run of prune.

4 Likes

Got it. I have a folder that I store an entire photo session, and after 90 days the selected files are already in another location, this entire photo session folder just serves as a backup if the client want something I haven’t delivered. So 90 days is a good amount of time for me.

If I understand right every time I delete these folders I need to set a prune for IE 7 days max, then after 7 days this folders will be gone after 2 prunes and a backup?

I think the 7 day thing is if you don’t run any backups for that long. Otherwise, the first prune will delete the snapshots and ‘collect’ all the relevant chunks - ready for their deletion in the second run. But according to your prune command, those files - if you delete them - won’t be gone for at least 90 days.

What is the behaviour of the prune command when there are more than one backup on a given day? (e.g. hourly backup)

Pruning works at the resolution of a day, so it doesn’t make sense to run it more than once a day. Otherwise, it works fine with hourly backups.

Usually, you’d set up the retention period to keep hourly backups for at least a day - perhaps a week or two, or more - so recent backups don’t get touched until they’ve ages awhile.

2 Likes

If I understand the question correctly… if you run the prune command to only keep 1 backup per day and you have hourly backups, then it’ll keep the oldest revision from the day (based on the thread linked below).

1 Like

Yep, that’s what I was after. Thank you!

A post was split to a new topic: Prune: exclude tags

Does -exhaustive imply -all?

No, -exhaustive only means to find ‘orphan’ chunks that are not referenced by any snapshots. It is a plausible use case that you can delete snapshots with a certain snapshot id and at the same time delete these ‘orphan’ chunks.

I think I understand: -all deletes snapshots (revisions) from all snapshot ids according to the specified retention policies; in doing so it deletes (or fossilizes) any chunks referenced by those revisions but not referenced anywhere else. And -exhaustive deletes chunks that aren’t referenced by any snapshot. Correct?

1 Like

This is correct…

1 Like

Reading this:

The -exclusive option will assume that no other clients are accessing the storage, effectively disabling the two-step fossil collection algorithm.

Actually i am backing up some NAS dirs to a storage. No other client has access to that storage, it’s a bucket i created on B2 only for backup purpose.

So it’s fine to always use

-exclusive ?

To only keep a 7-day history, would it be -keep 0:7 ?

Yes.

However it’s questionable why would you want such a short history? It may not accomplish what you may hope to accomplish (I.e. purging data for various compliance reasons).

Is the following correct?

If the keep option is not specified, no snapshots will be deleted and no new fossils created.

For example (assuming exclusive access to a storage) this command will only delete existing fossils, both referenced and unreferenced:

duplicacy prune -all -exhaustive -exclusive

Feature Request: -persist flag that deletes snapshots no matter if there are missing chunks.
Feature Request: -v verbose flag that prints the chunks that are (currently) deleted

3 Likes