Code: Select all
<#
------------------------------------------------------------------------------
AUTHOR: Robert Atkinson - April 2025
------------------------------------------------------------------------------
DESCRIPTION: Utility to allow servers to be chained together so that their backups run in sequence
------------------------------------------------------------------------------
RUN FREQUENCY : As required
PRERUN REQUISITES : None
PARAMETERS : Action -
- CreateTrigger - Create the trigger file for a server
- WaitForTrigger - Wait for the trigger file, then delete it
- DeleteTrigger - Delete the trigger file for a server
Server - Server name(s) to create triggers for
USAGE : "Backup Sync.ps1" -Action DeleteTrigger -Server "UKWSWOSQLPIN01" # Clear down the trigger file for a fresh run
"Backup Sync.ps1" -Action CreateTrigger -Server "UKWSWOSQLPIN01" # Create the trigger file to say the server snapshot is complete
"Backup Sync.ps1" -Action WaitForTrigger -Server "UKWSWOSQLPIN01" # Wait for the trigger file, then delete it and continue with the next backup
#>
Unfortunately, Veeam B&R can't pass parameters from the backup job config to the script being executed remotely, so the script has to be split into 3, one for each action. If I want to run the same process on a different backup, I'd need to copy the same scripts again, meaning 6 scripts to maintain and all doing the same thing.
What I'd like is the ability to pass parameters in the job configuration. I'm aware I could do something with a .BAT file to call the script with parameters instead or even split the backup and have them chain that way, but this Powershell 'Wait For' process is the cleanest way to do it.
Apologies if this enhancement is already logged somewhere - I couldn't find it in a search.
Thanks, Rob.