Host-based backup of VMware vSphere VMs.
Post Reply
sosborne
Enthusiast
Posts: 66
Liked: 5 times
Joined: Jan 30, 2018 12:06 pm
Full Name: Simon Osborne
Contact:

Retention Puzzle

Post by sosborne »

I have introduced a number of backup copy jobs to replace other equivalent jobs. My problem is that given that the two will effectively have the same retention and backup the same VMs at the point I disable the previous job the retention will no longer be applied to the older RP's. So at some point I will start accumulating RP's that would have replaced those that were two years old.

I have been having a look at Powershell as a potential way to make this happen but I don't see a distinct way of enforcing retention without running a job which I don't want to do. Perhaps I have missed it. Furthermore given that some of the jobs that do different things (SQL, EXCH etc) all have different numbers of RP's there is something else to bear in mind. This is probably best enforced by date. But will this be doable through Veeam Powershell and what will the after effects be as far as Veeam Console is concerned (if its outside of Veeam will we have missing RP's displayed, if so does it matter)?

The primary concern is to automate this process given the different numbers of RP's the jobs have, that old jobs are disabled, and that it will be a pain for colleagues to keep track of.

Any thoughts (if I have managed to explain it clearly)?

Thanks in advance.
foggy
Veeam Software
Posts: 21070
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Retention Puzzle

Post by foggy » 1 person likes this post

Hi Simon, the only way I see is to write a script that will delete restore points from disk outside Veeam B&R based on some acceptable criteria (after checking new backup chains, for example, or based on the new jobs success status). This will result in missing restore points in Veeam B&R UI, which can be addressed with the help of Forget functionality.
sosborne
Enthusiast
Posts: 66
Liked: 5 times
Joined: Jan 30, 2018 12:06 pm
Full Name: Simon Osborne
Contact:

Re: Retention Puzzle

Post by sosborne » 1 person likes this post

This command per repository will do the trick. And then once all the old RP's are phased out it can be disabled.

Get-ChildItem –Path "\\Server\drive$" -include "*.vbk", "*.vib" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-730))}

This Powershell line generates a list of target RP's a '| Remove-Item' will delete them. But I will make it a two step process which generates and e-mails a report with a separate script to do the dirty work if approved.
sosborne
Enthusiast
Posts: 66
Liked: 5 times
Joined: Jan 30, 2018 12:06 pm
Full Name: Simon Osborne
Contact:

Re: Retention Puzzle

Post by sosborne »

Code: Select all

#Variables for todays date, filename and path with timestamp, and the last date to be retained.

$CurrDate = (Get-Date -Format yyyyMMdd)
$LogFile = "c:\Temp\" + $CurrDate + "_Report.log"
$LastDate = (Get-Date).AddDays(-730)

#Command to list all files on UNC path(s) of extension .vbk or vib that are older than a target date, and to record that in a log file. Adding | Remove-Item also deletes those files.

Get-ChildItem -Path \\VEEAM-1\d$,\\VEEAM-2\d$ -include "*.vbk", "*.vib" -Recurse | Where-Object {($_.LastWriteTime -lt $LastDate)} >> $LogFile

#This emails the log file generated by the command above. The intention being that it is a two step process with a seperate script to delete the items after approval.

Send-MailMessage -from "veeam@domain.com" -to "me@domain.com" -subject "Monthly Veeam Retention Report (For Disabled Archive Jobs)" `
                       -body "Test retention report for backups older than a year." `
                       -Attachment $Logfile -smtpServer 1.2.3.4
In case anyone is interested here is the Powershell script I came up with to mail me a report for any restore points that maybe older then two years which is automatically kicked off by a scheduled task each month. I have a similar script to automatically delete those restore points which is manually initiated.
Post Reply

Who is online

Users browsing this forum: Google Feedfetcher and 66 guests