Anybody with a delete Backup Group script ?

hvisage

Renowned Member
May 21, 2013
278
26
93
<Obligatory don't do this at home warnings>

I've moved/copied backups between datastores for separating their retention/synchronisation rates, and now I need to delete quite a number of backups groups in the various datastores, and well... the GUI doesn't work wonders for my finger tips (touch pad) not my wrists (mouse) and especially my tapping finger.

So: the method seems to be doing a forget on each of the snapshots, OR to do a prune with like --keep-all 1 and then a last forget snapshot. However the part that buggers me is the scripting/grabbing of the snapshot time/date as it's a number in the json, and the text output is well... not quite script friendly, and before I embark on a jq .adventure thought to ask for pre-created scripts if shareable :)
 
FYI commandline option I'll be using for NOW:

Code:
for i in vm/10119 ct/70011 ct/70012 vm/10301 vm/10300 vm/30406
 do
  proxmox-backup-client snapshot list $i | grep Z |\
  awk '{print "proxmox-backup-client forget "$2}' | sh -x
done
 
there is proxmox-backup-debug (a bit like 'pvesh' in PVE - a tool for exploring/debugging the API and other things). curl also makes for a nice API client (especially if you use API tokens) - especially for simple stuff like this.
 
  • Like
Reactions: hvisage

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!