Different retention by directory, or forget specific path only?


I have the following situation: I am backing up all my important stuff by doing a backup of a single directory /data/.

Now in retrospect, I have realized that /data also contains a specific patch with data that is quite large, changes often, but does not need to be kept for long periods like the rest of the stuff in /data.

So basically, I would like to:
Periodically do a snapshot of /data/

Periodically run forget:
/data → keep retention/forget as is with versions being kept for months/years
/data/large-volatile-not-so-important-stuff → only keep two or three versions

Is that somehow achievable in a nice way with the snapshots I have already done, or do I need to disentangle these directories, and snapshot them separately?

Forget can only work on the granularity of snapshots. That is you’ll need two separate snapshots to which you can then apply separate forget policies. To reduce the size of the existing snapshots, you could use rewrite --exclude to remove the volatile data once you have a few new snapshots that only contain the volatile part.

1 Like