Remove-VBRBackup

Short Description

Removes selected backups.

Applies to

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides parameter sets that allow you to:

  • Remove selected backups from database.

Remove-VBRBackup [-Backup] <CBackup[]> [-WhatIf] [-Confirm]  [<CommonParameters>]

  • Remove selected backups from disk.

Remove-VBRBackup [-Backup] <CBackup[]> -FromDisk [-RunAsync] [-IncludeGFS] [-FromDBIfSPUnavailable] [-WhatIf] [-Confirm]  [<CommonParameters>]

Detailed Description

This cmdlet removes selected backups.

You can use the following options:

  • Remove from database. When you remove backup from database, you remove records about the backup from Veeam database. The backup files remain in repository. You can import such backups later with the Import-VBRBackup cmdlet.
  • Remove from disk. With this option, the backup is removed from database and from disk. This removal is complete and non-reversible.

To remove replicated VM, run the Remove-VBRReplica cmdlet.

To remove a backup job, run the Remove-VBRJob cmdlet.

Remove-VBRBackup Important!

This cmdlet removes all restore points of all VMs processed by the job. You should remove backups carefully considering the subsequent backup jobs that may fail to produce valid backup. To remove backup of individual VMs, run the Remove-VBRRestorePoint cmdlet.

With this cmdlet, you can remove backups created by all types of jobs: backup jobs, backup copy jobs, vCD jobs and Veeam Agent for Microsoft Windows backup jobs.

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

Backup

Specifies the array of backups you want to remove.

Accepts the CBackup object. To create this object, run the Get-VBRBackup cmdlet.

True

0

True (ByValue,
ByProperty
Name)

IncludeGFS

Defines that the cmdlet will remove backups with GFS flags (weekly, monthly and yearly).

SwitchParameter

False

Named

False

FromDBIfSPUnavailable

Defines that the cmdlet will remove backups from a database if a cloud provider is not available.

SwitchParameter

False

Named

False

FromDisk

If indicated, the backup will be permanently removed from disk. Otherwise, only the information about the backup is deleted from database.

SwitchParameter

True

Named

False

RunAsync

Defines that the command returns immediately without waiting for the task to complete.

SwitchParameter

False

Named

False

WhatIf

Specifies whether the cmdlet writes a message that describes the effects of running the cmdlet without actually performing any action.

SwichParameter

False

Named

False

Confirm

Specifies whether the cmdlet displays a prompt that asks if the user is sure that they want to continue.

SwitchParameter

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Output Object

None.

Examples

Remove-VBRBackupExample 1. Removing Specific Backups from Database [Using Pipeline]

This example shows how to remove the backups named Backup Job 01 and Backup Job 02 from database.

Get-VBRBackup -Name "Backup Job 01", "Backup Job 02" | Remove-VBRBackup

Perform the following steps:

  1. Run the Get-VBRBackup cmdlet. Specify the Name parameter value.
  2. Pipe the cmdlet output to the Remove-VBRBackup cmdlet.

Remove-VBRBackupExample 2. Removing Backups from Disk with Specified Names [Using Pipeline]

This example shows how to remove the backups with names ending with 2012 from disk.

Get-VBRBackup -Name *2012 | Remove-VBRBackup -FromDisk*

Perform the following steps:

  1. Run the Get-VBRBackup cmdlet. Specify the Name parameter value.
  2. Pipe the cmdlet output to the Remove-VBRBackup cmdlet. Provide the FromDisk parameter.

Remove-VBRBackupExample 3. Removing Backup from Disk [Using Variable]

This example shows how to delete backups from disk.

$backup = Get-VBRBackup -Name "Backups"

Remove-VBRBackup -Backup $backup -FromDisk

Perform the following steps:

  1. Run the Get-VBRBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
  2. Run the Remove-VBRBackup cmdlet. Set the $backup variable as the Backup parameter value. Provide the FromDisk parameter.

Related Commands

Get-VBRBackup