Delete orphaned backups

janvv

Active Member
Jun 21, 2020
64
12
28
67
52.24154182722349, 5.117853866801705
When I delete a VM or LXC, then the backup is not deleted along with it.
My backup disk is having a lot of backups that do no longer belong to an existing machine.
The pruning system doesn't take care of that either.

What is the best way of cleaning those old backup files?
 
  • Like
Reactions: SilicaStorm
For Vzdump backups just open the folder that you use as your Vzdump backup storage and delete the files you don't want anymore. With PBS backups they are still listed in the PBS webUI and you can use it to delete them.
 
Last edited:
  • Like
Reactions: SilicaStorm
hmm... I was hoping to find a way (or a shell script) to select backup files that do not belong to an existing machine.
In my retention scheme, backups will be removed when they are older than 1 week. So I will add a cron job to clean up files having -mtime +7. Then I do not need to do anything manually.