reclaiming space from restic backups
17.08.2023 1 min readrestic -r /path/to/restic-repo snapshots
# List of snapshots
restic -r /path/to/repo forget <SNAPSHOT_ID>
I’d been cleaning up old snapshots generated by Restic when I realized I wasn’t getting any space back. So I consulted the docs.
It turns out, you need to use the prune
command to remove unused data:
du -hs ./restic-repo/*
4.0K ./restic-repo/config
31G ./restic-repo/data
3.5M ./restic-repo/index
8.0K ./restic-repo/keys
4.0K ./restic-repo/locks
32K ./restic-repo/snapshots
restic -r /path/to/restic-repo prune
du -hs ./restic-repo/*
4.0K ./restic-repo/config
28G ./restic-repo/data
1.9M ./restic-repo/index
8.0K ./restic-repo/keys
4.0K ./restic-repo/locks
32K ./restic-repo/snapshots
Seems like you can use prune
as a flag when you’re removing snapshots (which is probably what I’ll be doing in the future):
restic forget --keep-last 1 --prune
References
Built with Astro and Tailwind 🚀