I have a punch of files being backed up using File to Tape Backup Job. Due to the size of the files, I have split the files into multiple jobs in order to run success and fast backup jobs. Those files are getting change and new folders are added into the backup location. In order to have a reliable backup and I don't miss any files newly being added to the backup location, I'm thinking of scripting this to amend the existing jobs to include the differential files/new files added.
I don't know if my logic is right or wrong, but simply I just need to add the new files/folders added to the backup location and I don't miss them.
Code: Select all
Asnp VeeamPssnapin
$Job = Get-VBRTapeJob -Name "Office 365 Backup -0"
$1 = Get-Item -Path $Job.Object | Select -ExpandProperty Name
$2 = Get-ChildItem -Path 'E:\Backup\Office 365' | Where-Object { $_.Name -le "1"} | Select -ExpandProperty Name
$Add = Compare-Object $1 -DifferenceObject $2 | ? {$_.Sideindicator -eq '=>'} | Select InputObject
#How can I add the difference objects into the existing jobs...
Add-VBRFileToTapeJob -Name $Job -Object $Add