PowerShell script exchange
Post Reply
daniel_rogers
Influencer
Posts: 12
Liked: never
Joined: Feb 03, 2015 6:53 am
Full Name: Daniel Rogers
Contact:

Forget unavailable backups via powershell?

Post by daniel_rogers »

Hello!

Just wondering if it is possible to trigger the 'Forget -> All unavailable backups' via powershell.

- I am using Veeam Agent for Windows
- Only performing 1 backup per week (FULL)
- Only wish to keep 1 week retention
- Powershell script runs weekly to delete files across the repo -le 7 days
- Kicks off a Rescan-VBREntity -AllRepositories afterwards to update the restore points as unavailable

It would be nice and clean if they could be forgotten/removed completely within the same process.

This is the manual documentation for the process: https://helpcenter.veeam.com/docs/backu ... tml?ver=95

Any ideas?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Forget unavailable backups via powershell?

Post by veremin »

You can remove unavailable backups from configuration, using Remove-VBRBackup cmdlet.
daniel_rogers
Influencer
Posts: 12
Liked: never
Joined: Feb 03, 2015 6:53 am
Full Name: Daniel Rogers
Contact:

Re: Forget unavailable backups via powershell?

Post by daniel_rogers »

Hi Vladimir,

Thanks for replying. I saw that command but it will remove ALL the backups point. I wanted to run it in between the backup to disk and the tape kicking off to ensure it only writes the latest backup. That is a configurable option for the Veeam tape jobs but I don't know if it works 100%.

I might run Remove-VBRBackup across the Agent jobs pre-backup so it only makes one point anyway. Thanks!
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Forget unavailable backups via powershell?

Post by veremin »

Are you saying that even if you specify for Remove-VBRBackup only unavailable backup entities, the cmdlet will still remove whole backup chain?
frankois
Lurker
Posts: 2
Liked: never
Joined: Oct 07, 2022 2:49 pm
Full Name: Francois Guilbaud
Contact:

Re: Forget unavailable backups via powershell?

Post by frankois »

Hi,
It's been 5 years since the last message, but problem is still on.
If I use Remove-VBRBAckup with option "FromDBIfSPUnavailable" (option "FromDisk " is mandatory to use it), it will delete all the backup chain.
I have not found any powershell command to "forget all unavailable restore points". The only way I found is to run it through the application.

François.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Forget unavailable backups via powershell?

Post by oleg.feoktistov »

Hi François,

Have a look at Remove-VBRBackupFile cmdlet available starting from v11a.

Best regards,
Oleg
frankois
Lurker
Posts: 2
Liked: never
Joined: Oct 07, 2022 2:49 pm
Full Name: Francois Guilbaud
Contact:

Re: Forget unavailable backups via powershell?

Post by frankois »

Hi Oleg,

Thanks so much, this is the command I needed, how could I miss it when I read the doc?! Looking for documentation a Friday afternoon was not a good idea :)
Anyway, here is the codeI used to forget unavailable backups (if it can help any veeam user) :

Code: Select all

Get-VBRBackup -Name "<NAME OF THE BACKUP>" | Get-VBRBackupFile | ?{$_.IsAvailable -eq $false} | %{
    Remove-VBRBackupFile -backupFile $_ -Confirm:$false
}
Once again, thanks a lot, and have a nice week-end.
Regards.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests