Host-based backup of VMware vSphere VMs.
Post Reply
cardendave
Service Provider
Posts: 41
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Veeam Removal Drive Powershell

Post by cardendave »

Hi All

I am implmenting a Powershell script to delete the contents on the rotated drive before backup. I am aware there is a regkey to do this but it seemed to clear off some of the non rotated backups.

I see there are some Veeam PS commands to delete the backups from the database etc etc. Should I be including these functions? Or just deleting the files?

Anyone have any scripts they wish to share? :)

Thanks

Dave
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Veeam Removal Drive Powershell

Post by PTide »

Hi,
I am aware there is a regkey to do this but it seemed to clear off some of the non rotated backups
Could you elaborate on that please?

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

Re: Veeam Removal Drive Powershell

Post by veremin »

There are Windows PowerShell cmdlets, using which you can find directory and files that are present inside it, and remove those files:

- Get-ChildItem (how to find oldest .vbk file)
- Remove-Item (how to remove files that have been written to tapes)

Thanks.
cardendave
Service Provider
Posts: 41
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Re: Veeam Removal Drive Powershell

Post by cardendave »

PTide wrote:Hi,

I am aware there is a regkey to do this but it seemed to clear off some of the non rotated backups

Could you elaborate on that please?

Thanks
https://www.veeam.com/kb1154
HKLM\Software\Veeam\Veeam Backup and Replication
ForceDeleteBackupFiles (DWORD)

Set to 3 to make the job delete the entire contents of the backup job’s folder only.
Set to 5 to make the job delete the entire contents of the root backup repository folder, potentially deleting any files belonging to other jobs. Note that if the backup repository points at the volumes root folder, the entire volume's contents are erased.
When each backup is made on rotated media it is creating a full backup. The above key deletes the contents of the job on the drive. However this has caused some issues has it has been deleting some other jobs which is not rotated media.

I believe the best advise is to use Powershell to delete the drive contents. However do I also use the cmdlets to delete the jobs from the Veeam database? Or just delete the files and leave the database untouched?

Does anyone have any scripts they are using?
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Veeam Removal Drive Powershell

Post by PTide »

However this has caused some issues has it has been deleting some other jobs which is not rotated media.
Are you sure that the repository where the other jobs are pointed to does not have "Rotated media" option enabled? If that holds true and you still observe the other jobs' backups being deleted please contact support team and post your case ID.

Thanks
cardendave
Service Provider
Posts: 41
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Re: Veeam Removal Drive Powershell

Post by cardendave »

100%

Spoke to Veeam support who advised a Powershell script
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Removal Drive Powershell

Post by veremin »

Can you provide us with a support ticket ID, because what you're describing looks strange and we'd like to clarify it internally? Thanks.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 28 guests