Skip to content

Latest commit

 

History

History
127 lines (90 loc) · 3.28 KB

Wait-AzRecoveryServicesBackupJob.md

File metadata and controls

127 lines (90 loc) · 3.28 KB
external help file Module Name ms.assetid online version schema
Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Backup.dll-Help.xml
Az.RecoveryServices
F671A7CC-2A27-460E-B064-2FBF1B9C6A0B
2.0.0

Wait-AzRecoveryServicesBackupJob

SYNOPSIS

Waits for a Backup job to finish.

SYNTAX

Wait-AzRecoveryServicesBackupJob [-Job] <Object> [[-Timeout] <Int64>] [-VaultId <String>]
 [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]

DESCRIPTION

The Wait-AzRecoveryServicesBackupJob cmdlet waits for an Azure Backup job to finish. Backup jobs can take a long time. If you run a backup job as part of a script, you may want to force the script to wait for job to finish before it continues to other tasks. A script that includes this cmdlet can be simpler than one that polls the Backup service for the job status. Set the vault context by using the -VaultId parameter.

EXAMPLES

Example 1: Wait for a job to finish

$vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
$Jobs = Get-AzRecoveryServicesBackupJob -Status InProgress -VaultId $vault.ID
Wait-AzRecoveryServicesBackupJob -Job $Jobs[0] -VaultId $vault.ID -Timeout 3600

This script polls the first job that is currently in progress until the job has completed or timeout period of 1 hour expired.

PARAMETERS

-DefaultProfile

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

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Job

Specifies the job to wait for. To obtain a BackupJob object, use the Get-AzRecoveryServicesBackupJob cmdlet.

Type: System.Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Timeout

Specifies the maximum time, in seconds, that this cmdlet waits for the job to finish. It is recommended to specify a time-out value.

Type: System.Nullable`1[System.Int64]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-VaultId

ARM ID of the Recovery Services Vault.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Object

System.String

OUTPUTS

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

NOTES

RELATED LINKS

Get-AzRecoveryServicesBackupJob