Backup-AzRecoveryServicesBackupItem

Starts a backup for a Backup item.

Syntax

Backup-AzRecoveryServicesBackupItem
      -Item <ItemBase>
      [-ExpiryDateTimeUTC <DateTime>]
      [-BackupType <BackupType>]
      [-EnableCompression]
      [-VaultId <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Backup-AzRecoveryServicesBackupItem cmdlet starts a backup for a protected Azure Backup item that is not tied to the backup schedule. You can do an initial backup immediately after you enable protection or start a backup after a scheduled backup fails. Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Start a backup for a Backup item

PS C:\> $NamedContainer = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM -Status Registered -Name "pstestv2vm1" 
PS C:\> $Item = Get-AzRecoveryServicesBackupItem -Container $NamedContainer -WorkloadType AzureVM 
PS C:\> $Job = Backup-AzRecoveryServicesItem -Item $Item
Operation        Status               StartTime            EndTime                   JOBID                           
------------     ---------            ------               ---------                 -------                                         
pstestv2vm1      Backup               InProgress           4/23/2016 5:00:30 PM      cf4b3ef5-2fac-4c8e-a215-d2eba4124f27

The first command gets the Backup container of type AzureVM named pstestv2vm1, and then stores it in the $NamedContainer variable. The second command gets the Backup item corresponding to the container in $NamedContainer, and then stores it in the $Item variable. The last command triggers the backup job for the Backup item in $Item.

Parameters

-BackupType

Type of backup to be performed

Type:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.BackupType
Accepted values:Full, Differential, Log, CopyOnlyFull
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableCompression

If enabling compression is required

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExpiryDateTimeUTC

Specifies an expiry time as a DateTime object.

Type:System.Nullable`1[System.DateTime]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Item

Specifies a Backup item for which this cmdlet starts a backup operation.

Type:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ItemBase
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ItemBase

System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

String

Outputs

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.JobBase