Preserve oldest snapshot when forget policies not satisfied #1036
-
I would like to suggest At the moment with
$ rustic forget
on the 1st of Feb 2024 the last snapshot from 31st of Dec is removed - it is only 31 days old.... I think it is something from |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
@kapitainsky What do you expect as outcome here? I think restic does exactly the same here - there are 2 last, 2 daily, 2 weekly and 2 monthly snapshots kept... |
Beta Was this translation helpful? Give feedback.
-
The latest |
Beta Was this translation helpful? Give feedback.
-
That logic you have linked is already implemented in rustic (it was implemented in rustic before it was added to restic). And in this example it doesn't apply, as all |
Beta Was this translation helpful? Give feedback.
-
And let's be pragmatic and logical - I want to keep last 2 monthly snapshots. In human terms it means I do not expect 1 month old snapshot to be removed (given it is the last one). This is where pure algorithm logic does not work in real life. IMO it is very practical to not touch the oldest snapshot - this is what Look at my example - I want to keep 2 months snaps - suddenly I have only last few days. And before running forget I had 1 month. |
Beta Was this translation helpful? Give feedback.
-
@kapitainsky Did you read my last comment? I do think that rustic behaves exactly like restic here and that restic also would remove that last snapshot. Simply because it keeps 2 monthly snapshots, as requested: The one from 2024-02-01 and the one from 2024-01-31. Can you explain why you expect rustic to keep the snapshot from 2023-12-31 which would be the third monthly snapshot? |
Beta Was this translation helpful? Give feedback.
-
Because between 2024-02-01 and 2024-01-31 there is 1 day difference? And you are dropping one from 2023-12-31? Which maybe satisfy some artificial logic of 2 months but defies any common sense. Let's say I started my Very simple adjustment to prevent it is (like |
Beta Was this translation helpful? Give feedback.
-
If you want to keep monthly snapshots which are less then 2 month old, the
Please run |
Beta Was this translation helpful? Give feedback.
-
I agree that this |
Beta Was this translation helpful? Give feedback.
-
FWIW, the logic you are requesting and which has been added recently to restic has been added to rustic here: |
Beta Was this translation helpful? Give feedback.
If you want to keep monthly snapshots which are less then 2 month old, the
keep-within-monthly
option would be the right choice. Or, you tell rustic to keep 3 monthly snaphots knowing that in the beginning of a month the monthly snapshot is an early one.Please run
restic forget --dry-run
for your example. It will produce exactly the same result as rustic.