Veeam: Change Restore points and deleted VMs retention period
By Arne Fokkema - ICT-Freak.nl
If you want to change the amount of restore points and the deleted VMs retention period, you can do this for your backup jobs by hand. But if you need to change a lot of Veeam Backup & Replication Jobs like I needed to do. You can find these settings in the Backup Job properties:
If you’re a reader of my blog, you know I like to automate this kind of job with Powershell. So I created a function to perform this change for me.
The function:
#requires -pssnapin VeeamPSSnapIn
Function Change-RestorePoints{
<#
.SYNOPSIS
Change the Backup restore points and deleted VMs retention period
.DESCRIPTION
.NOTES
Authors: Arne Fokkema
.PARAMETER JobName
A Backup Job in Veeam Backup & Replication
.PARAMETER RetainDays
The amount of restore points
.PARAMETER RetainCycles
The amount of days for Deleted VMs retention period
.EXAMPLE
PS> Change-RestorePoints -JobName "Job-01" -RetainDays "21" -RetainCycles "21"
#>
param(
[parameter(valuefrompipeline = $true,
position = 0,
Mandatory = $true,
HelpMessage = "Enter a Veeam B&R JobName")]
$JobName,
[parameter(valuefrompipeline = $true,
position = 0,
Mandatory = $true,
HelpMessage = "Enter the amount of restore points to keep on disk")]
$RetainDays,
[parameter(valuefrompipeline = $true,
position = 0,
Mandatory = $true,
HelpMessage = "Enter a deleted VMs retention period in days")]
$RetainCycles
)
begin{
$vbrjob = Get-VBRJob | where {$_.Name -eq $JobName}
}
process{
$options = $vbrjob.GetOptions()
$options.RetainDays = $RetainDays
$options.RetainCycles = $RetainDays
Write-Host "Changing RetainDays: $($RetainDays) and RetainDays: $($RetainCycles) for job: $($vbrjob.Name)"
$vbrjob.SetOptions($options)
}
}
To change a particular job on a Veeam Backup & Replication server you can use the following one-liner:
Change-RestorePoints -JobName "Job-01" -RetainDays "30" -RetainCycles "30"
To change all the jobs on a particular Veeam Backup & Replication Server you can use the following for each loop:
foreach($job in (Get-VBRJob | Sort Name)){
Change-RestorePoints -JobName $job.Name -RetainDays "14" -RetainCycles "14"
}
The output will look like this:
- xtravirt's blog
- Login or register to post comments
Spotlight:
VMware Documentation Downloader v11.08.30
Updated for vSphere 5 - A free tool for those on the move who need information FAST
vSphere 5 License Entitlement Changes
See what has changed in the license entitlement in vSphere 5?
Thin Client vs Zero Client
The differences between Thin and Zero desktop clients for VDI


