How to Reduce the Restic Prune Interval to Retrieve Deleted Velero Backup Disc Space
When deleting velero backups, the 'delete backup' commands are asynchronous: they are queued and executed later by restic like garbage collection. The default restic prune interval is seven days, so it can take up to seven days before a velero backup is actually deleted from disc.
To retrieve disc space from deleted backups more quickly, you can force restic to prune 'delete backup' commands within five to ten minutes by executing:
kubectl -n velero get resticrepositories -oname \
| xargs -I{} kubectl -n velero patch {} \
--type='json' \
-p '[{"op":"replace", "path":"/status/lastMaintenanceTime", "value":"2020-01-01T00:00:00Z"}]'