[SOLVED] Backups: trigger pruning manually

Jul 7, 2021
48
5
13
45
I have mounted a SMB share for backups which proved very unreliable during the backup process. I switched to a hook script now, copying the backup file via scp to the remote destination. However, I would still like to trigger the pruning of backups as setup for this storage location. Can I do this via script?
 
Code:
pvesm prune-backups <storage> [OPTIONS]

Prune backups. Only those using the standard naming scheme are considered. If no keep options are specified, those from the storage configuration are used.

<storage>: <string>

    The storage identifier.
--dry-run <boolean>

    Only show what would be pruned, don’t delete anything.
--keep-all <boolean>

    Keep all backups. Conflicts with the other options when true.
--keep-daily <N>

    Keep backups for the last <N> different days. If there is morethan one backup for a single day, only the latest one is kept.
--keep-hourly <N>

    Keep backups for the last <N> different hours. If there is morethan one backup for a single hour, only the latest one is kept.
--keep-last <N>

    Keep the last <N> backups.
--keep-monthly <N>

    Keep backups for the last <N> different months. If there is morethan one backup for a single month, only the latest one is kept.
--keep-weekly <N>

    Keep backups for the last <N> different weeks. If there is morethan one backup for a single week, only the latest one is kept.
--keep-yearly <N>

    Keep backups for the last <N> different years. If there is morethan one backup for a single year, only the latest one is kept.
--type <lxc | qemu>

    Either qemu or lxc. Only consider backups for guests of this type.
--vmid <integer> (1 - N)

    Only consider backups for this guest.

see "man pvesm"
 
If no keep options are specified, those from the storage configuration are used.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!