Script before and after Backup (Windows)

twey

Renowned Member
Oct 15, 2016
15
1
68
40
Hi

I'm trying to achieve to run a Script before and after the Backup Snapshot of a Windows VM. I can run successfully the Script within the Console of the Host, but I don't figure out how I can run this in the right order.

Command run order:
Code:
qm guest exec 102 -- "powershell.exe" "-File" "C:\scripts\backup_pre.ps1"
vzdump 102 --mode=snapshot --compress zstd
qm guest exec 102 -- "powershell.exe" "-File" "C:\scripts\backup_post.ps1"

This works but took too long until the Post Script runs. Is the a possibility to run the Post Script immediately after the Snapshot inside the "vzdump 102 --mode=snapshot --compress zstd" Command was done?

Or is there another way to run the single steps that are done inside the vzdump command?
 
I have seen this hook for Linux VMs but I can't find this option for Windows VMs. Do you have any hints witch File this hooks are inside Windows VMs?
 
I have seen this hook for Linux VMs but I can't find this option for Windows VMs. Do you have any hints witch File this hooks are inside Windows VMs?
Sorry, no experience with that. Maybe find out how the Windows service for it call the executable and add the --fsfreeze-hook= parameter?
There appears to be some kind of hookscipt for backups but I don't know the details. Maybe this post can get you started: https://forum.proxmox.com/threads/3...pbs-host-before-backup-job.111666/post-484924 ?
 

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!