Autorestic supports declaring snapshot policies for location to avoid keeping old snapshot around if you don't need them.
This is based on Restic's snapshots policies, and can be enabled for each location as shown below:
Note This is a full example, of course you also can specify only one of them
1linkversion: 2
2link
3linklocations:
4link etc:
5link from: /etc
6link to: local
7link options:
8link forget:
9link keep-last: 5 # always keep at least 5 snapshots
10link keep-hourly: 3 # keep 3 last hourly snapshots
11link keep-daily: 4 # keep 4 last daily snapshots
12link keep-weekly: 1 # keep 1 last weekly snapshots
13link keep-monthly: 12 # keep 12 last monthly snapshots
14link keep-yearly: 7 # keep 7 last yearly snapshots
15link keep-within: '2w' # keep snapshots from the last 2 weeks
You can specify global forget policies that would be applied to all locations:
1linkversion: 2
2link
3linkglobal:
4link forget:
5link keep-daily: 30
6link keep-weekly: 52
You can also configure autorestic
to automatically run the forget command for you after every backup. You can do that by specifying the forget
option.
1linkversion: 2
2link
3linklocations:
4link etc:
5link from: /etc
6link to: local
7link forget: prune # Or only "yes" if you don't want to prune
8link options:
9link forget:
10link keep-last: 5
Home Quick Start Installation Configuration Upgrade