This is an archive version of the document. To get the most up-to-date information, see the current version.

Add-VBRComputerBackupJob

Short Description

Creates Veeam Agent backup jobs.

Applies to

Product Edition: Community, Standard, Enterprise, Enterprise Plus

Syntax

Add-VBRComputerBackupJob -OSPlatform <VBRAgentType> -Type <VBRComputerBackupJobType> -Mode <VBRComputerBackupJobMode> -BackupObject <Object[]> -BackupType <VBRComputerBackupJobBackupType> [-EnableSchedule [<SwitchParameter>]] [-IndexingOptions <VBRComputerIndexingOptions[]>] [-EnableIndexing [<SwitchParameter>]] [-ApplicationProcessingOptions <VBRApplicationProcessingOptions[]>] [-EnableApplicationProcessing [<SwitchParameter>]] [-DeletedComputerRetentionPolicy <Int32>] [-EnableDeletedComputerRetention [<SwitchParameter>]] [-ScriptOptions <VBRJobScriptOptions>] [-NotificationOptions <VBRNotificationOptions>] [-CompactFullOptions <VBRFullBackupOptions>] [-HealthCheckOptions <VBRFullBackupOptions>] [-SyntheticFullOptions <VBRSyntheticFullOptions>] [-ScheduleOptions <VBRObject>] [-StorageOptions <VBRStorageOptions>] [-RetentionPolicy<Int32>] [-BackupRepository <CBackupRepository>] [-DestinationOptions <VBRComputerDestinationOptions>][-IncludeUsbDrives [<SwitchParameter>]] [-SelectedVolumes <IVBRSelectedVolume[]>] [-SelectedFilesOptions <VBRSelectedFilesBackupOptions>] [-Description <String>] [-Name <String>] [-ActiveFullOptions <VBRFullBackupOptions>] [-UseSnapshotlessFileLevelBackup [<SwitchParameter>]] [<CommonParameters>]

Detailed Description

This cmdlet creates a Veeam Agent backup job. You can create the following Veeam Agent backup jobs:

  • ManagedByAgent: to create a backup policy. The backup policy acts as a template to configure Veeam Agent backup jobs on Windows and Linux computers, protected by Veeam Agent. When the policy is created, the backup process is managed by Veeam Agent itself.
  • ManagedByBackupServer: to create a Veeam Agent backup job. When this job is created, it is managed by the Veeam Backup server and runs on the backup server in a similar way as a regular job for VM data backup.

For more information about Veeam Agent jobs and backup policies, see the Creating Veeam Agent Backup Jobs section of the Veeam Agent Management Guide.

To create the backup policy, you must specify the protection group with the protected computers that you plan to back up and the target location for storing backups.

To create the Veeam Agent backup job, you must specify the protection group with the protected computers and the repository for storing backups.

To enable guest file indexing and application-aware processing, you must first specify the settings for these options.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

OSPlatform

Specifies the OS of the protected computers:

  • Windows: for Windows computers.
  • Linux: for Linux computers.

True

Named

False

 

Type

Specifies the type of the protected computers:

  • Workstation: for remote workstations or laptops. Veeam Backup & Replication will apply the settings that are available in the Workstation edition of Veeam Agent for Microsoft Windows.
  • Server: for standalone servers. Veeam Backup & Replication will apply the settings available for the Server edition of Veeam Agent for Microsoft Windows.
  • FailoverСluster: for failover clusters.

True

Named

False

 

Mode

Specifies the Veeam Agent backup job mode:

  • ManagedByAgent: use this option to create the backup policy.
    NOTE: This mode is the only available mode for jobs that back up workstations.
  • ManagedByBackupServer: use this option to create a Veeam Agent backup job.
    NOTE: This mode is the only available mode for jobs that backs up failover clusters.

True

Named

False

 

BackupObject

Specifies an array of protection groups and discovered computers that you want to add to the Veeam Agent backup job.

Accepts the VBRDiscoveredEntity[] and VBRProtectionGroup[] types.

True

Named

False

 

BackupType

Specifies the scope of data that you want to back up.

  • EntireComputer: for entire computer image backups.
  • SelectedFiles: for file-level backups.
    NOTE:
    This option is not available for the job that backs up failover clusters.
    If you select this option, you will not be able to switch to the EntireComputer or SelectedVolumes options.
  • SelectedVolumes: for volume-level backups.

True

Named

False

 

SelectedFiles
Options

For file-level backups.

Specifies an array of folders with files that you want to back up.

Accepts the VBRSelectedFilesBackupOptions type.

False

Named

False

 

SelectedVolumes

For volume-level backups.

Specifies an array of computer volumes that you want to back up.

Accepts the following types:

  • IVBRSelectedVolume[]
    NOTE: You can set this type for Windows-based computers only.
  • VBRLinuxSelectedVolume
    NOTE: You can set this type for Linux-based computers only.

False

Named

False

 

Name

Specifies the name that you want to assign to the Veeam Agent backup job.

False

Named

False

 

Description

Specifies the description of the Veeam Agent backup job.

False

Named

False

 

IncludeUsb
Drives

Indicates that Veeam Backup & Replication will back up the periodically connected USB drives.

NOTE: You can set this parameter only for Veeam Agent jobs that back up entire images of Windows computers.

False

Named

False

 

DestinationOptions

Specifies the target backup location for the protected computers that you want to add to the backup policy.

NOTE: This parameter does not work for Veeam Agent backup jobs.

Accepts the VBRComputerDestinationOptions type.

False

Named

False

 

BackupRepository

Specifies the target backup location for the Veeam Agent backup job.

NOTE: This parameter is not available for backup policies.

Accepts the CBackupRepository type.

False

Named

False

 

RetentionPolicy

Specifies the retention policy for backups created by the Veeam Agent backup job.

NOTE: Retention policy specifies the following settings:

  • For jobs that back up Windows workstations the retention policy specifies the number of days.
  • For jobs that back up Linux computes the retention policy specifies the number of restore points.
  • For jobs that back up servers, the retention policy specifies the number of restore points.

False

Named

False

 

SyntheticFull
Options

Specifies the schedule for synthetic full backup.

Accepts the VBRSyntheticFullOptions type.

NOTE: This parameter is not available for backup policies that Veeam Agent job applies to Linux computers.

False

Named

False

 

ActiveFull
Options

Specifies the schedule for active full backup.

Accepts the VBRFullBackupOptions type.

False

Named

False

 

HealthCheck
Options

Specifies the health check schedule for the latest restore point.

Accepts the VBRFullBackupOptions type.

NOTE: This parameter is not available for backup policies that Veeam Agent job applies to Linux computers.

False

Named

False

 

EnableDeleted
ComputerRetention

Indicates that Veeam Backup & Replication will keep the backup data for machines that have not been backed up for a certain period of time. Veeam Backup & Replication will remove backup files of these computers in case Veeam Agent backup job will not be able to back up these computers for the specified period.

Use the DeletedComputerRetentionPolicy parameter to specify the number of days for keeping the backup files of machines that have not been backed up for a certain period of time.

False

Named

False

 

DeletedComputer
RetentionPolicy

For the EnableDeletedComputerRetention option.

Specifies the period of time in days to keep backup files for machines that have not been backed up for a certain period of time. Veeam Backup & Replication will remove backup files of these computers in case Veeam Agent backup job will not be able to back up these computers when the specified period of time is over.

Default: 14 days.

False

Named

False

 

CompactFull
Options

Specifies the schedule for the compact operation of full backups created by the Veeam Agent backup job.

Accepts the VBRFullBackupOptions type.

Veeam Backup & Replication will defragment and compact a full backup per the schedule settings specified in the VBRFullBackupOptions object.

NOTE: This parameter is not available for backup policies that Veeam Agent job applies to Linux computers.

False

Named

False

 

StorageOptions

Specifies the settings for compression and storage optimization of the target backup repository.

Accepts the VBRStorageOptions type.

False

Named

False

 

NotificationOptions

Specifies notification settings for the Veeam Agent backup job.

Accepts the VBRNotificationOptions type.

False

Named

False

 

ScriptOptions

Specifies custom script settings. Veeam Backup & Replication will run pre-job and post-job scripts per these settings.

NOTE: This parameter is not available for backup policies that Veeam Agent job applies to Windows computers.

Accepts the VBRJobScriptOptions type.

False

Named

False

 

EnableApplication
Processing

Enables application-aware processing for the Veeam Agent backup job.

False

Named

False

 

Application
Processing
Options

Specifies the settings for application-aware processing.

Accepts the VBRApplicationProcessingOptions type.

False

Named

False

 

EnableIndexing

Indicates that the guest file system indexing is enabled.

False

Named

False

 

IndexingOptions

Specifies indexing scope settings.

Accepts the VBRComputerIndexingOptions type.

False

Named

False

 

EnableSchedule

Indicates that Veeam Backup & Replication will schedule the Veeam Agent backup job to run on a regular basis.

False

Named

False

 

ScheduleOptions

Specifies the settings for Veeam Agent job schedule.

Accepts the types returned by the following cmdlets:

False

Named

False

 

UseSnapshotless
FileLevelBackup

Indicates that the cmdlet will create the crash-consistent file-level backup without a snapshot.

NOTE: Available for Linux machines with the file-level backup scope only.

False

Named

False

 

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Return Type

Example 1

This example shows how to create the Veeam Agent backup job for Windows servers.

  1. Run Get-VBRProtectionGroup to get the protection group with Windows computers that you want to back up. Save the result to the $group variable.
  2. Run Get-VBRBackupRepository to get the repository, where you want to keep backups. Save the result to the $repository variable.
  3. Run Add-VBRComputerBackupJob with the $group and $repository variables. Specify the following parameters:
  • Set the ManagedByBackupServer value for the Mode parameter to create the Veeam Agent backup job.
  • Set the EntireComputer value for the BackupType parameter to create an entire computer image backup.

$group = Get-VBRProtectionGroup -Name "WindowsGroup"

$repository = Get-VBRBackupRepository -Name "Default Backup Repository"

Add-VBRComputerBackupJob -OSPlatform Windows -Type Server -Mode ManagedByBackupServer -Name "WindowsJob" -BackupObject $group -BackupType EntireComputer -BackupRepository $repository

Example 2

This example shows how to create the Veeam Agent backup job for Linux workstation. A backup job will run on Fridays at 7:00 PM.

  1. Run Get-VBRProtectionGroup to get the protection group with Linux computers that you want to back up. Save the result to the $group variable.
  2. Run Get-VBRBackupRepository to specify the repository. Save the result to the $repository variable.
  3. Run New-VBRComputerDestinationOptions to get the target location for backups. Save the result to the $destination variable.
  4. Run New-VBRDailyOptions to specify the daily options for the backup job schedule. Save the result to the $daily variable.
  5. Run New-VBRLinuxScheduleOptions with the $daily variable to create the backup job schedule. Save the result to the $schedule variable.
  6. Run Add-VBRComputerBackupJob with the $group, $schedule and $destination variables. Set the ManagedByAgent value for the Mode parameter to create the backup policy.

$group = Get-VBRProtectionGroup -Name "LinuxGroup"

$repository = Get-VBRBackupRepository -Name "Default Backup Repository"

$destination = New-VBRComputerDestinationOptions -OSPlatform Linux -BackupRepository $repository

$daily = New-VBRDailyOptions -DayOfWeek Friday -Period 19:00

$schedule = New-VBRLinuxScheduleOptions -Type Daily -DailyOptions $daily

Add-VBRComputerBackupJob -OSPlatform Linux -Type Workstation -Mode ManagedByAgent -Name "LinuxJob" -BackupObject $group -BackupType EntireComputer -DestinationOptions $destination -ScheduleOptions $schedule -EnableSchedule

Example 3

This example shows how to create a Veeam Agent backup job for a failover cluster. The job will run with the following settings:

  • Veeam Backup & Replication will run scripts located at the C:\script\ path before and after the backup job.
  • The Veeam Agent backup job will still run if scripts fail.

To create the Veeam Agent backup job, perform the following steps:

  1. Run Get-VBRProtectionGroup to get the protection group with a failover cluster that you want to back up. Save the result to the $group variable.
  2. Run Get-VBRBackupRepository to get the repository, where you want to keep backups. Save the result to the $repository variable.
  3. Run New-VBRScriptProcessingOptions to specify the script settings. Save the result to the $script variable.
  4. Run New-VBRApplicationProcessingOptions to specify the application-aware processing settings. Use the $script variable to specify script settings. Save the result to the $processoptions variable.
  5. Run Add-VBRComputerBackupJob with the $group and $repository variables. Use the SelectedVolumes parameter to back up the required volume.

$group = Get-VBRProtectionGroup -Name "ClusterGroup"

$repository = Get-VBRBackupRepository -Name "Default Backup Repository"

$script = New-VBRScriptProcessingOptions -ProcessingAction IgnoreFailures -ScriptPrefreezeCommand C:\script\pre-script.bat -ScriptPostthawCommand C:\script\post-script.bat

$processoptions = New-VBRApplicationProcessingOptions -BackupObject $group -OSPlatform Windows -Enable -GeneralTransactionLogAction ProcessLogsWithJob -ScriptProcessingOptions $script

Add-VBRComputerBackupJob -OSPlatform Windows -Type FailoverCluster -Mode ManagedByBackupServer -Name "NewCluster" -BackupObject $group -BackupType SelectedVolumes -SelectedVolumes "D:\" -BackupRepository $repository -EnableApplicationProcessing -ApplicationProcessingOptions $processoptions

Example 4

This example shows how to create a Veeam Agent backup job for Linux server. The backup job will create volume-level backups.

  1. Run Get-VBRProtectionGroup to get the protection group with Linux computers that you want to back up. Save the result to the $group variable.
  2. Run Get-VBRBackupRepository to specify the repository. Save the result to the $repository variable.
  3. Run New-VBRComputerDestinationOptions to get the target location for backups. Save the result to the $destination variable.
  4. Run New-VBRLinuxSelectedVolume to specify the volumes that you want to back up. Save the result to the $scope variable.
  5. Run Add-VBRComputerBackupJob with the $group, $destination and $scope variables. Set the ManagedByAgent value for the Mode parameter to create the backup policy. Set the SelectedVolumes value for the BackupType parameter to create a volume-level backup.

$group = Get-VBRProtectionGroup -Name "LinuxGroup"

$repository = Get-VBRBackupRepository -Name "Default Backup Repository"

$destination = New-VBRComputerDestinationOptions -OSPlatform Linux -BackupRepository $repository

$scope = New-VBRLinuxSelectedVolume -Type Device -Path "/dev/sda"

Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode ManagedByAgent -Name "LinuxServerJob" -BackupObject $group -BackupType SelectedVolumes  -DestinationOptions $destination  -SelectedVolumes  $scope

Related Commands

Get-VBRProtectionGroup

New-VBRComputerDestinationOptions

New-VBRDailyOptions

New-VBRLinuxScheduleOptions

New-VBRApplicationProcessingOptions

New-VBRLinuxSelectedVolume

I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.