PowerShell script exchange
Post Reply
habibalby
Veteran
Posts: 392
Liked: 33 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Edit Backup Job FileToTapeJob

Post by habibalby »

Hello,
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
Regards,
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Edit Backup Job FileToTapeJob

Post by veremin »

You will need to construct a new file to tape job object, using New-VBRFileToTapeObject cmdlet. The object should combine previous files and new ones.

Then, you will need to pass the resulting object to Set-VBRFileToTapeJob.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests