How Can We Help?
< All Topics
Print

Efficient Backup Maintenance: A Guide to Pruning and Removal in Proxmox

Pruning and removal of backups ensures efficient use of storage space and control of storage costs by removing unnecessary or outdated backups.

a) How do I prune and remove backups in Proxmox ?

1. You can use the proxmox-backup-client snapshot forget <snapshot> command to manually delete a backup snapshot.

Note: The command will permanently delete all archives in the backup snapshot, rendering them inaccessible and unrecoverable.

2. You can use the proxmox-backup-client snapshot forget <snapshot> –ns <ns> command if you forget a snapshot that is contained in the root namespace.

  • –keep-yearly<N>: Keep backups of the last <N> years. If there are multiple backups in a year, only the latest one is backed up.
  • –keep-last<N>: Keep the last<N> backup snapshots.
  • –keep-hourly<N>: Keep backups of the last <N> hours. If there are multiple backups within an hour, only the latest disk is backed up.
  • –keep-daily<N>: Keep backups of the last <N> days. If there are multiple backups in a day, only the latest one will be accepted.
  • –keep-weekly<N>: Keep backups for the past <N> weeks. If there are multiple backups for a week, only the last one is kept.

Note: Each week starts on Monday and ends on Sunday. The software uses the ISO week date system and correctly handles the weeks at the end of the year.

  • –keep-monthly<N>: Keep backups of the last <N> months. If there are multiple backups for a month, only the last one is kept.

3. You can also use the proxmox-backup-client prune host/elsa –dry-run –keep-daily 1 –keep-weekly 3 command to test your settings.

Note: Block storage does not free space through the prune or forget commands, as it still contains data blocks, and garbage collection is necessary to free up space.

4. You can also use the proxmox-backup-client prune <group> –keep-daily 7 –keep-weekly 4 –keep-monthly 3 command to remove the incomplete backups.

5. You can use the proxmox-backup-client snapshot protected update <snapshot> true command to protect single snapshots from being pruned or deleted.

6. You can use the proxmox-backup-client snapshot protected update <snapshot> false command to set the protected flag on the snapshot and prevent pruning or manual deletion of this snapshot until the flag is removed.

Note: The PullorSync job does not synchronize this flag, and to protect the sync snapshot, it must be manually done on the target backup server.

Table of Contents