Start-WBBackup

Start-WBBackup

Starts a one-time backup operation.

構文

Parameter Set: Policy
Start-WBBackup [-Policy] <WBPolicy> [[-Async]] [[-Force]] [[-AllowDeleteOldBackups]] [[-DonotVerifyMedia]] [ <CommonParameters>]




詳細説明

The Start-WBBackup cmdlet starts a one-time backup operation.

You can use the settings from an existing backup policy for the scheduled backup by specifying a WBPolicy object, or you can start a backup by using new settings. If you use new settings to create a backup, you must do the following:

     -- Specify the items to include in the backup by using the Add-WBVolume, Add-WBFileSpec, Add-WBSystemState, and Add-WBBareMetalRecovery cmdlets.

     -- Specify the location for backup storage by using the locations already defined in a WBBackupTarget object or by updating an object of that type.

Before you can add a backup target to a WBPolicy object, put the WBPolicy object in edit mode. To put the WBPolicy object in edit mode for a policy that you have set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The Get-WBPolicy cmdlet creates a new WBPolicy object that is already in edit mode.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

パラメーター

-AllowDeleteOldBackups

If specified, then deleting backups of older versions of the operating system is enabled.


エイリアス

なし

必須?

false

位置は?

4

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Async

Indicates that Windows PowerShell returns immediately after the backup starts and does not display status messages. If you specify this parameter and choose not to display status messages, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.


エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DonotVerifyMedia

Do not use. This parameter is not implemented in this version of the module.


エイリアス

なし

必須?

false

位置は?

5

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Force

Indicates that the backup starts automatically without prompting the user for confirmation.


エイリアス

なし

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Policy<WBPolicy>

Specifies a WBPolicy object that includes the policy settings for the backup by using an existing backup policy object.


エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • WBPolicy

    The Start-WBBackup cmdlet uses a WBPolicy object to determine what to include in the backup and where to store the backup.


出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • String

    If you do not specify the Async parameter, the Start-WBBackup cmdlet displays status messages from the currently running backup as strings. If you specify the Async parameter, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.


Example 1: Start a backup by using new settings

This example starts a backup by using new settings.


 

The first command creates a new backup policy object and stores it in a variable named $Policy.


PS C:\> $Policy = New-WBPolicy

 

The next command creates a backup source, adds the file named "C:\15-12-08_1645.jpg" to the backup source, and stores the backup source in a variable named $FileSpec.


PS C:\> $FileSpec = New-WBFileSpec -FileSpec C:\15-12-08_1645.jpg

 

This command associates the backup source in the $FileSpec variable with the backup policy in the $Policy variable.


PS C:\> Add-WBFileSpec -Policy $Policy -FileSpec $FileSpec

 

This command stores the volume that has the drive letter F: in the variable named $Volume.


PS C:\> $Volume = Get-WBVolume -VolumePath F:

 

This command stores the volume in the $Volume variable in the backup policy in the $Policy variable.


PS C:\> Add-WBVolume -Policy $Policy -Volume $Volume

 

This command adds the current system state options to the backup policy in the $Policy variable.


PS C:\> Add-WBSystemState $Policy

 

This command adds the ability to perform a bare-metal recovery to the backup policy in the $Policy variable.


PS C:\> Add-WBBareMetalRecovery $Policy

 

This command creates a new backup location object that contains the volume that has the drive letter D: and then stores that object in the $BackupLocation variable.


PS C:\> $BackupLocation = New-WBBackupTarget -VolumePath D:

 

This command adds the backup target based on the backup policy in the $Policy variable and the backup location in the $BackupLocation variable.


PS C:\> Add-WBBackupTarget -Policy $Policy -Target $BackupLocation

 

This command specifies that the backup policy in the $Policy variable uses Volume Shadow Copy Service (VSS) copy backups.


PS C:\> Set-WBVssBackupOptions -Policy $Policy -VssCopyBackup

 

This command starts the backup by using the backup policy in the $Policy variable.


PS C:\> Start-WBBackup -Policy $Policy

Example 2: Start a backup by using backup policy settings

This example starts a backup by using the settings for scheduled backups defined in a backup policy.

The first command gets the current backup policy and stores it in the variable named $Policy.

The second command starts the backup. Because the command specifies the Async parameter, the cmdlet returns immediately.

The third command gets the backup status and stores it in the variable named $BackupJob. Because the second command includes the Async parameter, you can view the backup status by using the Get-WBJob cmdlet.


PS C:\> $Policy = Get-WBPolicy
PS C:\> Start-WBBackup -Policy $policy -Async
PS C:\> $BackupJob = Get-WBJob

関連トピック

コミュニティの追加

追加
表示: