serializing backup/verify/prune/gc for better performance + disk life

RolandK

Renowned Member
Mar 5, 2019
951
187
88
51
hello,

i do backup to and external usb disk with hd-idle ( https://github.com/adelolmo/hd-idle ) utility. this saves a LOT of energy for my little s740 home server and pve mini servers/clusters in makerspace bonn and dingfabrik cologne.

unfortunately, i'm having a hard time scheduling the different tasks that they won't overlap and that there isn't too much gap in between, which result in unnecessary spindown and spin-up of the disk

there are 5 different places for schedules to be managed:
- schedule backup task on the pve server
- schedule gc task on pbs
- schedule prune task on pbs
- schedule verify task on pbs
- schedule replication task on pbs

what i'm missing is some sort of automatic start of "verify/prune/gc" triggered by the daily backup task on pve.

i made a shellscript to have prune/gc/verify in a serialized fashion, which works good to some degree, but i wonder if there isn't a more elegant way/approach
 
Last edited:
Last edited:
I want to do something similar. My idea was to run a script on the PVE that will use the PBS API to trigger and monitor those prune/GC/verify tasks (easier to limit privileges with an extra token just for starting those jobs compared to SSH I guess) and then shut down the PVE using the PVE API that is running the virtualized PBS.

But hook scripts on the PBS would be really useful for customization.
Would also be great if the PBS API could start and monitor ZFS scrubs/resilvering.
Otherwise I still would need to connect using SSH to do this, as I don't want to abort the long scrub/resilvering by shutting the PBS down.
 
Last edited:
  • Like
Reactions: RolandK
Or a "shutdown as soon as idle" option in addition to a normal shutdown accessible though webUI and API would be great too. So I can tell the PBS to shutdown but the PBS will monitor prune/GC/verify/sync/scrub/resilvering/replication, wait until none of these tasks are running anymore and only then actually trigger the shutdown.
 
Last edited:
A task queue and being able to select how many concurrent tasks the server can run would be nice to have
 
Hi, I found this discussion after being pointed to the bug.

I just want to add here as well, that I also would agree, that adding complex dependencies to the API is not a smart thing to do and to maintain. However, for those who are willing to work around real problems, I think server side hook scripts would really be the thing to do. Hook scripts could both wait and abort tasks while being transparently visible in both notifications and logging.

If one does manual scheduling at least being informed about schedules going wrong would be great.

However, my use case is even different. I need to schedule an upstream backup task (we have external disk storage). It would be really stupid to call this one during pruning or garbage collection (zfs snapshots protect me a bit, but I also want clean upstream backup states). Introducing parallel running cron scripts and not having the ability to use logging and notification is really something that bothers me.

Just adding a script config line (not editable by gui only showing in advanced) would help me a lot.

I now understand at least it was under discussion and didn't lead anywhere.
 

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!