PowerShell script exchange
Post Reply
Mental_floss
Novice
Posts: 3
Liked: never
Joined: Apr 05, 2019 3:58 pm
Full Name: John Doe
Contact:

Scripting volume level backup jobs with Linux agent

Post by Mental_floss » Apr 05, 2019 4:09 pm

I am running 9.3 U4a at a retailer with 200+ stores and I am looking to deploy Veeam with PowerShell. I have it 99% figured out except for the Linux backup job.

There is a Windows and Linux protection group at each location. When creating the Windows backup job I am able to use Add-VBRComputerBackupJob with the switches -BackupType SelectedVolumes -SelectedVolumes "C:\","D:\" to only backup C: and D: on all VMS in that Protection Group. With the Linux VMs I only want to backup volume groups VG00 and VG01. I use the switches -BackupType SelectedVolumes -SelectedVolumes "/dev/vg00","/dev/vg01" and the job fails with:

Code: Select all

Add-VBRComputerBackupJob : The specified computer backup job is invalid.
Source:
Job and SelectedVolumes OS platform mismatch
At line:1 char:1
+ Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode Managed ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-VBRComputerBackupJob], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Veeam.Backup.PowerShell.Cmdlets.AddVBRComputerBackupJob 
Help? TIA.

P.Tide
Product Manager
Posts: 5189
Liked: 448 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Scripting volume level backup jobs with Linux agent

Post by P.Tide » Apr 05, 2019 6:14 pm

Hi,

While I am awaiting for some response regarding why is it not working from the team, I want to ask you a question:

Have you tried going with "-BackupType EntireComputer"?

Thanks!

jhoughes
Veeam Software
Posts: 94
Liked: 21 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Scripting volume level backup jobs with Linux agent

Post by jhoughes » Apr 05, 2019 7:07 pm

Can you post your full script, or at least the full portion for the Linux agent jobs?
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

Mental_floss
Novice
Posts: 3
Liked: never
Joined: Apr 05, 2019 3:58 pm
Full Name: John Doe
Contact:

Re: Scripting volume level backup jobs with Linux agent

Post by Mental_floss » Apr 19, 2019 2:50 pm

P.Tide, yes if I create the Linux backup job with -BackupType EntireComputer the job is created and runs successfully.

jhoughes Here is the line I use to create the Linux backup job with "-BackupType EntireComputer". With this the job is created and it runs fine;

Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode ManagedByBackupServer -Name ($StoreNumber + "-LB") -BackupObject $LPG -BackupType EntireComputer -BackupRepository $VBRRepo -RetentionPolicy 14 -Description " " -ScheduleOptions $LBschedule -EnableSchedule

This line is where I create a backup of the Windows Protection Group to backup C: and D: only, works fine;

Add-VBRComputerBackupJob -OSPlatform Windows -Type Server -Mode ManagedByBackupServer -Name ($StoreNumber + "-WB") -BackupObject $WPG -BackupType SelectedVolumes -SelectedVolumes "C:\","D:\" -BackupRepository $VBRRepo -RetentionPolicy 14 -Description " " -ScheduleOptions $WBschedule -EnableSchedule

So what I was thinking should work to backup only VG00 and VG01 would be this;

Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode ManagedByBackupServer -Name ($StoreNumber + "-LB") -BackupObject $LPG -BackupType SelectedVolumes -SelectedVolumes "/dev/vg00","/dev/vg01" -BackupRepository $VBRRepo -RetentionPolicy 14 -Description " " -ScheduleOptions $LBschedule -EnableSchedule

Any attempt to use the "-BackupType SelectedVolumes" with Linux jobs gets me the OS Mismatch error. The documentation I am looking at only shows three options for -BackupType: EntireComputer, SelectedVolumes and SelectedFiles. Is Add-VBRComputerBackup the proper command to use to create a Linux agent backup job?

P.Tide
Product Manager
Posts: 5189
Liked: 448 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Scripting volume level backup jobs with Linux agent

Post by P.Tide » Apr 23, 2019 6:12 pm

Hi,

You should use New-VBRLinuxSelectedVolume and do something like this:

Code: Select all

$scope = New-VBRLinuxSelectedVolume -Type Device -Path "/dev/sda"
and pass that $scope to -SelectedVolumes

For multiple devices you need to create an pass an array:

Code: Select all

-SelectedVolumes @((New-VBRLinuxSelectedVolume -Type Device -Path "/dev/sda"), (New-VBRLinuxSelectedVolume -Type Device -Path "/dev/sdb"))
Thanks

Mental_floss
Novice
Posts: 3
Liked: never
Joined: Apr 05, 2019 3:58 pm
Full Name: John Doe
Contact:

Re: Scripting volume level backup jobs with Linux agent

Post by Mental_floss » Apr 30, 2019 5:21 pm

P.Tide, THANK YOU! That was a yuuuuuge help.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests