Forget policy once again

restic -r t:\Lenovo.restic forget --keep-within-daily 15d -w 4 -m 6 --keep-within-hourly 2d
repository f47692d3 opened (repository version 2) successfully, password is correct
Applying Policy: keep 4 weekly, 6 monthly snapshots, hourly snapshots within 2d, daily snapshots within 15d
keep 1 snapshots:
ID        Time                 Host               Tags                Reasons           Paths
---------------------------------------------------------------------------------------------------------------------------------
bff4da25  2022-12-12 21:38:59  LENOVO-IDEAPAD330  lenovo.ideapad.330  weekly snapshot  
                                                                      monthly snapshot 
                                                                      hourly within 2d  
                                                                      daily within 15d  
                                                                                      
                                                                                                                                                            
                                                                                    
---------------------------------------------------------------------------------------------------------------------------------
1 snapshots

remove 1 snapshots:
ID        Time                 Host               Tags                Paths
---------------------------------------------------------------------------------------------------------------
a8bbeaf0  2022-12-12 21:36:13  LENOVO-IDEAPAD330  lenovo.ideapad.330  
---------------------------------------------------------------------------------------------------------------
1 snapshots

[0:00] 100.00%  1 / 1 files deleted

Why restic removes this snapshot?

Because it is older than the other snapshot and both are within the same hour.

Both snapshots would meed the criteria by themselves, but since you have two snapshots within that same hour (which is the smallest granularity), restic only keeps the newest one out of those.

It wouldn’t make sense that out of multiple snapshots where it only needs to keep one, it keeps he oldest one. So instead it keeps the newest one.

2 Likes