Currently we have a Powershell script that runs as a scheduled task to delete backup files after X days (X being the retention period date).
If Veeam had the ability to delete files after their retention period lapsed that would be great so we didn't have to rely on a scheduled task with a service account (which the password can change) causing the scheduled task to fail without notifying us.
So anyone else can use the script I will paste it below until Veeam (Hopefully) integrates this in a later release/patch
Code: Select all
#Gets the current date of the system.
$Now = Get-Date
#Days to keep on hand
$Days = "9"
#Select location of files, network location work. Ex: \\Server\Share
$TargetFolder = "LocationOfFiles"
#Specify the extension you would like to use (VRB,VBK,VIB)
$Extension = "*.vbk"
#This defines the amount of days to keep on hand for the deletion.
$LastWrite = $Now.AddDays(-$Days)
#Defines files based on the last write time filter and specified folder.
$Files = Get-Childitem $TargetFolder -Include $Extension -Recurse | Where {$_.LastWriteTime -le "$LastWrite"}
foreach ($File in $Files)
{
if ($File -ne $NULL)
{
write-host "Deleting File $File" -ForegroundColor "DarkRed"
Remove-Item $File.FullName | out-null
}
else
{
Write-Host "No more files to delete!" -foregroundcolor "Green"
}
}