Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9961

PowerShell • Unable to delete backup from disk with Powershell script before backup starts

$
0
0
Given is a backup called "USB backup", the repository is simply called "USB".

This backup takes place once a weekend on a USB drive. Before the backup starts, it should simply delete the backup from the previous week.

I created a Powershell script that I run directly from the backup task (USB Backup => Storage => Advanced => Scripts => Run the following script before the job).

The Powershell script has the following content:

Code:

Get-VBRBackup -Name "USB-Backup" | Remove-VBRBackup -FromDisk -Confirm:$false
When I call the script as admin via Powershell, it deletes the backup from the previous week.

However, when I start the backup job, Veeam says the job ran correctly, but the previous week's backup is not deleted.

I've already put the whole thing into a batch file but without success.

What am I doing wrong?

Statistics: Posted by dk-one — Apr 20, 2024 1:44 pm



Viewing all articles
Browse latest Browse all 9961

Latest Images

Trending Articles



Latest Images