What's still missing is to use this setting when executing backups as we do with 'maxfiles' at the moment, and also GUI integration.
archive_info has been extended to include more information, mainly for being able to tell when a backup doesn't use a standard name. But the information might be useful elsewhere as well. I also included a few tests and updated the archive_info tests. Non-standard backups are ignored when pruning. I chose 'protected' to mark those, 'ignore' could also be used. The information from directory-storage backups and from PBS backups don't fully match up, e.g. I created volid for PBS by using backup group + ctime and translate backup type ct->lxc, vm->qemu, so that the possible values don't depend on the backend. Regarding the API endpoints: there's a regex below '{storage}/content', namely '{volume}', so it's not possible to create endpoints like '{storage}/content/prunebackups'. Instead, I introduced '{storage}/prunebackups'. Fabian Ebner (6): PBSPlugin: list_volumes: filter by vmid if specified Expand archive_info to include ctime, vmid and is_std_name Introduce prune-backups property for directory-based storages Add prune_backups to storage API Whitespace cleanup Add API and pvesm calls for prune_backups PVE/API2/Storage/Makefile | 2 +- PVE/API2/Storage/PruneBackups.pm | 153 ++++++++++++++++++++ PVE/API2/Storage/Status.pm | 72 +++++----- PVE/CLI/pvesm.pm | 27 ++++ PVE/Storage.pm | 44 +++++- PVE/Storage/CIFSPlugin.pm | 1 + PVE/Storage/CephFSPlugin.pm | 1 + PVE/Storage/DirPlugin.pm | 5 +- PVE/Storage/GlusterfsPlugin.pm | 5 +- PVE/Storage/NFSPlugin.pm | 5 +- PVE/Storage/PBSPlugin.pm | 52 +++++++ PVE/Storage/Plugin.pm | 190 +++++++++++++++++++++++-- test/archive_info_test.pm | 10 ++ test/prune_backups_test.pm | 237 +++++++++++++++++++++++++++++++ test/run_plugin_tests.pl | 1 + 15 files changed, 752 insertions(+), 53 deletions(-) create mode 100644 PVE/API2/Storage/PruneBackups.pm create mode 100644 test/prune_backups_test.pm -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel