Hi all!
I set up restic 0.17.0 on a server a few days ago and it works fine, but I’m confused by the following results of restic forget (I removed the Hosts, Paths and Size columns):
$ restic forget --prune --group-by host --keep-within 48h --keep-daily 14 --keep-weekly 8 --keep-monthly 24 --keep-yearly 4
Applying Policy: keep 14 daily, 8 weekly, 24 monthly, 4 yearly snapshots and all snapshots within 48h of the newest
keep 9 snapshots:
ID        Time                 Host        Tags        Reasons           Paths                   Size
-----------------------------------------------------------------------------------------------------------
46b93809  2024-08-20 18:51:40  myserver                daily snapshot    /etc/environment
                                                       weekly snapshot   /opt/REDACTED
                                                       monthly snapshot  /opt/pgadmin
                                                       yearly snapshot   /root/restic-backup.sh
8081eda8  2024-08-20 22:33:13  myserver                daily snapshot    /etc/environment
                                                                         /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
48f81068  2024-08-21 14:27:14  myserver                within 48h        /etc/environment        29.508 MiB
                                                                         /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
ad303df3  2024-08-21 16:00:14  myserver                within 48h        /etc/environment        29.508 MiB
                                                                         /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
90480b00  2024-08-21 17:50:12  myserver                within 48h        /etc/environment        29.508 MiB
                                                       daily snapshot    /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
2ea12ea4  2024-08-22 04:00:13  myserver                within 48h        /etc/environment        29.509 MiB
                                                                         /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
e9794f9e  2024-08-22 16:00:13  myserver                within 48h        /etc/environment        29.510 MiB
                                                       daily snapshot    /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
a73dfc74  2024-08-23 07:38:13  myserver                within 48h        /etc/environment        29.510 MiB
                                                                         /opt/REDACTED
                                                                         /opt/pgadmin
                                                                         /root/pgbackup
                                                                         /root/restic-backup.sh
90e7c3f2  2024-08-23 07:41:14  myserver                within 48h        /etc/environment        29.510 MiB
                                                       daily snapshot    /opt/REDACTED
                                                       weekly snapshot   /opt/pgadmin
                                                       monthly snapshot  /root/pgbackup
                                                       yearly snapshot   /root/restic-backup.sh
-----------------------------------------------------------------------------------------------------------
My first question was: how can both the first and second snapshots listed (46b93809 and 8081eda8) be considered a daily snapshot? They are from the same day, after all. (In case the time zone is relevant: Europe/Berlin, currently UTC+2.)
Second, why are the first and last snapshots (46b93809 and 90e7c3f2) considered weekly, monthly and yearly snapshots when they are in the same week, month and year, respectively?
Re-checking the documentation, I found a sentence I must have overlooked the first time:
If there are not enough snapshots to keep one for each duration related
--keep-{within-,}*option, the oldest snapshot is kept additionally.
Does that indeed explain everything? I just want to make sure I understand restic’s logic here.
Kind regards,
Jens