Compare Veeam Backup Copy and Replication Jobs Configured
If you use Veeam Backup and Replication to perform backup, copy, as well as replication jobs, how do you see the differences between the jobs setup? ย In other words, do you have copy and replication jobs setup for servers where you have backup jobs configured? ย Using the Veeam Powershell commandlets, we can Compare Veeam Backup Copy and Replication Jobs Configured. ย Let’s see how to do this.
Compare Veeam Backup Copy and Replication Jobs Configured
Using the builtin Veeam commandlets, we can utilize Powershell to create a list of servers that we have backup jobs for and then compare that list with our copy and replication jobs to see the differences.
Working on the premise that we have named our jobs differently such as appending something likeย -repl orย -copy to the end of the replication or copy jobs, we can run our Veeam commandlets to gather the backup jobs, copy jobs, and replication jobs, then compare them.
Getting Backup Jobs
We can get our backup jobs and send them to a variable calledย backupjobs using the following.
$backupjobs = get-vbrjob | where-object {$_.Name -notmatch "-copy|-repl"} | select -expandproperty Name
To find our copy jobs given the naming convention proposed, we can run the following:
$copyjobs = get-vbrjob | where-object {$_.Name -like "*-copy*"} | select -expandproperty Name
Next, we need to strip off the appendedย -copy from the job name so we can compare the list. ย To do that we can use the replace command against our $copyjobs variable:
$copystrip= $copyjobs -replace "-.*"
Now, to actually compare the sanitized copy names against our backupjobs, we can run the following. ย This will showย only the servers in ourย $backupjobs array that don’t exist in theย $copystrip array.
$backupjobs | where {$copystrip -notcontains $_} | sort
Of course, you can send these to variables for further use cases if need be.
Thoughts
There are so many ways to “skin a cat” here with querying your jobs and the above is simply an idea for getting started with using Powershell for taking a look at your Veeam jobs. ย The above was a handy way for me to quickly compare Veeam backup copy and replication jobs configured in a Veeamย environment and see which jobs are missing that may need to be created.