PowerShell script exchange
Post Reply
jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

How to add Agent Backup Job

Post by jed-hyper »

I'm starting to write a script for the setup and execution of an Windows Agent backup
I can't find the powershell command to Add Agent Backup Job
Is this supported in Veeam Backup & Replication 9.5 Update3 (9.5.0.1536) ?
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How to add Agent Backup Job

Post by tdewin »

Unfortunately not everything is possible today with PowerShell in combination with the Veeam Agent:
https://helpcenter.veeam.com/docs/backu ... tml?ver=95

However I'm sure product management is taking this in consideration for the future
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to add Agent Backup Job

Post by veremin »

Correct, we do plan to support this in the next product update. Thanks.
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How to add Agent Backup Job

Post by tdewin »

BTW one thing that is possible is that you use a CSV file in your protection group. If you then need to add new machines, you can just add FQDN's / IPs to the CSV file. The protection group will then pick them up later
vguinot@safehost.com
Lurker
Posts: 1
Liked: never
Joined: Apr 07, 2016 9:02 am
Full Name: Vincent Guinot
Contact:

Re: How to add Agent Backup Job

Post by vguinot@safehost.com »

We are using PowerShell to integrate the results of jobs in our own CRM, so I'm eager to see this feature included. Can you communicate a rough timeframe for the next update ?
kevin@wei.com
Influencer
Posts: 15
Liked: 4 times
Joined: Apr 04, 2012 8:49 pm
Full Name: Kevin Wood
Contact:

Re: How to add Agent Backup Job

Post by kevin@wei.com »

I'm very interested in this for the Linux Agent as well. We have a customer that is using the Linux agents to backup servers at roughly 80+ stores. I have written the powershell code to build all the protection groups and add the necessary servers, but I can't take it to the next level of building out the backup jobs, unless someone has a trick I'm not aware of.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to add Agent Backup Job

Post by veremin »

Unfortunately, you cannot configure agent backup jobs via PowerShell. The functionality is coming in the next update. Thanks.
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: How to add Agent Backup Job

Post by jhoughes »

I'm absolutely looking to control our agent jobs with PowerShell, would love to be able to include an example of the functionality into my presentation for VeeamOn.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
sparky.spb
Veeam Software
Posts: 1
Liked: 1 time
Joined: May 15, 2015 2:19 pm
Full Name: Dmitry.Shumilov
Contact:

Re: How to add Agent Backup Job

Post by sparky.spb » 1 person likes this post

Just in case, starting from 9.5u4 you can create a Veeam agent backup job via PowerShell using the following instruction:
https://helpcenter.veeam.com/docs/backu ... l?ver=95u4

Here is an example:

# add Veeam Powershell snapins
Add-PSSnapin VeeamPSSnapin

# Job Name
$job_name = "My new job"

# Protectiopn group to add to job
$protection_group = "My protection group"

# Included directories
$include_dirs = "/etc,/root,/home"

# Excluded directories
$exlude_dirs = "/etc/,/home/dummy"

# Veeam backup repo
$repository = Get-VBRBackupRepository -Name "Default Backup Repository"
$destination = New-VBRComputerDestinationOptions -OSPlatform Linux -BackupRepository $repository

# Schedule plan
$daily = New-VBRDailyOptions -Type Everyday -Period 19:10
$schedule = New-VBRServerScheduleOptions -Type Daily -DailyOptions $daily

# Backup retention
$retention = 35

# Encryption & Storage
$enc_key = Get-VBREncryptionKey -Description "Encryption Key"
$storage = New-VBRStorageOptions -CompressionLevel Optimal -StorageOptimizationType LANTarget -EnableEncryption -EncryptionKey $enc_key
$synthetic = New-VBRSyntheticFullOptions -Enable -Days Friday

# Notification
$notification = New-VBRNotificationOptions -EnableAdditionalNotification -AdditionalAddress user@example.com

# Create job
$source = New-VBRSelectedFilesBackupOptions -OSPlatform Linux -BackupSelectedFiles -SelectedFiles $include_dirs.split(",") -ExcludeMask $exlude_dirs.split(",")
$object = Get-VBRProtectionGroup -Name $protection_group
$indexing = New-VBRComputerIndexingOptions -OSPlatform Linux -BackupObject $object -IndexingMode IndexEverything

Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode ManagedByBackupServer -Name $job_name -BackupRepository $repository -BackupObject $object -BackupType SelectedFiles -SelectedFilesOptions $source -DestinationOptions $destination -ScheduleOptions $schedule -EnableSchedule -RetentionPolicy $retention -EnableIndexing -IndexingOptions $indexing -SyntheticFullOptions $synthetic -NotificationOptions $notification -StorageOptions $storage
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: How to add Agent Backup Job

Post by jhoughes »

Yes, I covered the new functionality in my automation session at VeeamON 2019, to show the full cycle of deployment and job creation/scheduling.

Thanks for following up with posting that and adding the documentation link. I had forgotten to update this thread.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests