PowerShell script exchange
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

Sorry for keeping silence - have been investigating the issue internally.

Turned out it was a bug - that backup service account is used to apply retention regardless of the specified share credentials. The bug affects both PowerShell and UI. The bug is planned to be fixed in the next product update.

Thanks.
aj_potc
Expert
Posts: 150
Liked: 37 times
Joined: Mar 17, 2018 12:43 pm
Contact:

Re: Retention Policy issues...

Post by aj_potc »

Hi Vladimir,

Sorry to bring up this old topic, but I'm having exactly the same issue in Veeam Free version 9.5.0.1922. I'm using a PowerShell script to run daily backups, and I've changed retention to "In2Weeks" from a previous setting of "In1Month". However, this new setting isn't being applied -- backups older than 2 weeks are not removed. My backups are going to local storage, not to a network share, so I don't suspect that permissions are the problem.

Is it necessary to manually restart the various Veeam Windows services after I've made a change to the retention settings in the PowerScript file? Or should these settings be taken automatically by Veeam each time the script is run (in my case, daily)?

Or is this problem still a known bug that hasn't been addressed yet?

Thanks very much for any feedback.
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

Since each VeeamZIP file acts as independent full backup file, changes made to new VeeamZIP files (including retention ones) don't get propagated to previous backups. Thanks!
aj_potc
Expert
Posts: 150
Liked: 37 times
Joined: Mar 17, 2018 12:43 pm
Contact:

Re: Retention Policy issues...

Post by aj_potc »

Thanks very much for that important note. I assumed the changes would propagate to older backups, but it makes sense that they wouldn't if Veeam is creating them independently.

Is there any way I can tell what propagation settings were used in generating a particular VBK file? I'm not finding anything related to this in the Backup and Replication interface.

Thanks again!
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

If you're versed in SQL DB parsing, you can check it directly in configuration database. Otherwise, let our support team guide you. Thanks!
vasm@verocel.pl
Lurker
Posts: 1
Liked: never
Joined: Oct 31, 2018 11:34 am
Full Name: vasm
Contact:

[MERGED] -AutoDelete don`t work

Post by vasm@verocel.pl »

Hi

I have free veeam backup 9.5.
I create task scheduler and powershell script i got from this web page:
https://www.veeam.com/blog/wp-content/u ... pdated.zip

The backup file is create but not deleted for 3 day later. How technically veeam delete this file?
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

Known issue that is fixed in Update 4; so, stay tuned. Thanks!
Soarer18
Lurker
Posts: 2
Liked: never
Joined: Feb 01, 2019 10:23 am
Contact:

Re: Retention Policy issues...

Post by Soarer18 »

Hi,

I did update to 9.5.4.2615.Update4, but still the backups are not deleted on a fileshare, but the creation of the backups is working.

Thanks!
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

Then, kindly, open a case and share its number with us. Thanks!
Soarer18
Lurker
Posts: 2
Liked: never
Joined: Feb 01, 2019 10:23 am
Contact:

Re: Retention Policy issues...

Post by Soarer18 »

Thanks, #03394201
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

I've just checked internally bug tracking system - unfortunately, the fix has slipped from this update (almost at last minute); should be implemented in one of the next product updates.

I apologize for providing misleading information.
egsilva
Lurker
Posts: 1
Liked: never
Joined: Feb 07, 2019 12:19 pm
Contact:

[MERGED] Problems with retention of backup (Veeam Free)

Post by egsilva »

Hi everyone,

I've been having problems with retention of backups in the company that I work. We use Veeam Backup & Replication 9.5 (Free Edition), and we use scripts to backup. Since some days ago, the retention configured in the script is like "In2Weeks". When the script use this configuration, something wrong happens. Backup occur without any problem, but the older backups aren't deleted. By the time I configure the retention script with "Never", backup runs properly. I've already compared the script with other scripts that we have in our structure, but nothing was found. What can I do to solve this problem?

I attached the script below:

Code: Select all

# Autor: Annonymous
# Data Criação: 14/03/2017
# Alteração/Motivo:
# 
# 

##################################################################
#                   User Defined Variables
##################################################################

# Names of VMs to backup separated by semicolon (Mandatory)
$VMNames = "ABCSRV002", 
                   "ABCSRV014"

# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "ABCHOST01"

# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
$Directory = "E:\Backup\VMs"

# Desired compression level (Optional; Possible values: 0 - None, 4 - Dedupe-friendly, 5 - Optimal, 6 - High, 9 - Extreme) 
$CompressionLevel = "5"

# Quiesce VM when taking snapshot (Optional; VMware Tools are required; Possible values: $True/$False)
$EnableQuiescence = $False

# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $False

# Encryption Key (Optional; path to a secure string)
$EncryptionKey = ""

# Retention settings (Optional; By default, VeeamZIP files are not removed and kept in the specified location for an indefinite period of time. 
# Possible values: Never , Tonight, TomorrowNight, In3days, In1Week, In2Weeks, In1Month)
$Retention = "In1Week"

##################################################################
#                   Notification Settings
##################################################################

# Enable notification (Optional)
$EnableNotification = $True

# Email SMTP server
$SMTPServer = "192.168.10.220"

# Email FROM
$EmailFrom = "bkpvm@abc.com.br" 

# Email TO
$EmailTo = "infra@abc.com.br"

# Email subject
$EmailSubject = "BKPVMS"

##################################################################
#                   Email formatting 
##################################################################

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"

##################################################################
#                   End User Defined Variables
##################################################################

#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin

$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()

foreach ($VMName in $VMNames)
{
  $VM = Find-VBRViEntity -Name $VMName -Server $Server
  
  If ($EnableEncryption)
  {
    $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | ConvertTo-SecureString)
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
  }
  
  Else 
  {
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
  }
  
  If ($EnableNotification) 
  {
    $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
    $FailedSessions =  $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
  
  if ($FailedSessions -ne $Null)
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={$FailedSessions.Title}})
  }
   
  Else
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={($TaskSessions | sort creationtime -Descending | select -first 1).Title}})
  }
  
  }   
}
If ($EnableNotification)
{
$Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
$Message.Subject = $EmailSubject
$Message.IsBodyHTML = $True
$message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer)
$SMTP.Send($Message)
}

Thanks in Advance
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retention Policy issues...

Post by veremin »

Known issue; planned to be fixed in one of the future product updates. Thanks!
andrew@my2dollars.ca

Re: Retention Policy issues...

Post by andrew@my2dollars.ca »

Same issue here. Has the plan been finalized? My VeeamZip backups using the PS script work except for retention. It has NEVER worked for me. I'm running the latest VBR and backups from months ago continue to sit in my E:\Backups folder even though I have $Retention set to delete "In1Week"
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests