Hi,
I’m struggling to understand the retention policy with restic. I’m making use of Backrest which I believe fundamentally uses Restics retention policies.
I’d like to run 2 different backups.
Appdata
Runs every 12 hours
0-2 weeks - Keep all
2 weeks - 3 months - Keep 1 per day
3 months - 6 months - Keep 1 per week
6 months - 12 months - Keep 1 per month
12 months+ - Keep none
Userdata
Runs every 2 hours
0-2 weeks - Keep all
2 weeks - 3 months - Keep 1 per day
3 months - 6 months - Keep 1 per week
6 months - 12 months - Keep 1 per month
12 months+ - Keep none
ChatGPT in it’s infinite wisdom suggests the following
Field |
Value |
Hourly |
28 |
Daily |
90 |
Weekly |
52 |
Monthly |
0 |
Yearly |
0 |
But I’m not convinced it’s correct. |
|
Any help would be greatly appreciated. I’m currently trying to migrate away from Duplicacy 
1 Like
I don’t know anything about Backrest, but if I’m reading the restic docs and doing the basic math/logic right, I’d say you want this:
--keep-within 14d
--keep-daily 90
--keep-weekly 26
--keep-monthly 12
1 Like
Thanks for taking the time to reply, it’s greatly appreciated.
Here’s a little screenshot of what Backrest provides regarding retention policies. I do have the ability to add custom flags to the Restic command so perhaps that might be the easier approach with what you’ve provided.
Seems to me that with goals you laid out in your first post, you want/need to combine retaining “by count” with retaining “by time period.” That’s easy on the command line, but seems it’s not possible with Backrest.
Since no one has yet corrected me, I think if you put what I have above as flags into a restic forget —keep…. —prune
command, you will be good.
1 Like
I will give this a go, thanks for all your help!
1 Like