I’m sure I’m just interpreting this wrong.
I’m currently testing Restic, trying and experimenting on a test server, before this is put in production.
Backups seem to be working very well, but as storage is expensive, I want to ensure older data is expired as soon as possible, and not kept forever.
In this experiment, I’m trying to delete ALL snapshots except the last.
I’m assuming that the last snapshot will contain the “state” of the last time I ran the backup.
So, after creating 3 snapshots, I ran:
# source /opt/restic/.restic.env ; /usr/local/bin/restic forget --keep-last 1 --prune
However, none of the 3 snapshots were deleted, with the following reasons:
repository abcdabcd opened successfully, password is correct
Applying Policy: keep the last 1 snapshots snapshots
keep 1 snapshots:
ID Time Host Tags Reasons Paths
--------------------------------------------------------------------------------------------
abcd1234 2019-12-20 22:35:00 server.host.com daily last snapshot /...
--------------------------------------------------------------------------------------------
1 snapshots
keep 1 snapshots:
ID Time Host Tags Reasons Paths
--------------------------------------------------------------------------------------------
efgh5678 2019-12-20 22:59:15 server.host.com daily last snapshot /...
--------------------------------------------------------------------------------------------
1 snapshots
keep 1 snapshots:
ID Time Host Tags Reasons Paths
--------------------------------------------------------------------------------------------
ijkl9101 2019-12-20 23:23:32 server.host.com daily last snapshot /...
--------------------------------------------------------------------------------------------
1 snapshots
Is anyone able to explain me why?
I was expecting only the latest snapshot to stay.
Thank you very much.