restic version
restic 0.18.0 compiled with go1.24.1 on linux/amd64
export RESTIC_REPOSITORY=$HDD/backup/backup-quick
export RESTIC_PASSWORD=$(sudo -u user zsh -c "gpg --decrypt $PASS/restic.gpg")
restic forget --keep-last 1 -r $RESTIC_REPOSITORY
restic prune
$PASS
is a folder where I store my gpg files, the file $PASS/restic.gpg
outputs the restic password
restic forget output:
...
1 snapshots
restic prune output:
repository 07e03227 opened (version 2, compression level auto)
loading indexes...
[0:00] 100.00% 1 / 1 index files loaded
loading all snapshots...
finding data that is still in use for 82 snapshots
[0:00] 100.00% 82 / 82 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:00] 100.00% 198 / 198 packs processed
to repack: 0 blobs / 0 B
this removes: 0 blobs / 0 B
to delete: 0 blobs / 0 B
total prune: 0 blobs / 0 B
remaining: 30177 blobs / 3.112 GiB
unused size after prune: 0 B (0.00% of remaining size)
done
restic snapshots output:
...
82 snapshots
Previously, I had more than 1100 snapshots and I couldn’t eliminate them for some reason, then I changed the command
restic forget --prune --keep-last 1 -r $RESTIC_REPOSITORY
to
restic forget --keep-last 1 -r $RESTIC_REPOSITORY
restic prune
and I managed to delete the majority of the snapshots and stay with 82
now I can’t delete any further.