Discussions specific to the VMware vSphere hypervisor
Post Reply
cardendave
Service Provider
Posts: 33
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Veeam Removal Drive Powershell

Post by cardendave » Jan 13, 2017 8:17 am

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

P.Tide
Product Manager
Posts: 5134
Liked: 443 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Veeam Removal Drive Powershell

Post by P.Tide » Jan 13, 2017 8:49 am

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: 16514
Liked: 1373 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Removal Drive Powershell

Post by veremin » Jan 13, 2017 11:28 am

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: 33
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Re: Veeam Removal Drive Powershell

Post by cardendave » Jan 13, 2017 3:13 pm

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?

P.Tide
Product Manager
Posts: 5134
Liked: 443 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Veeam Removal Drive Powershell

Post by P.Tide » Jan 13, 2017 4:47 pm

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: 33
Liked: 1 time
Joined: Jul 22, 2015 7:59 am
Full Name: Dave King
Contact:

Re: Veeam Removal Drive Powershell

Post by cardendave » Jan 13, 2017 5:20 pm

100%

Spoke to Veeam support who advised a Powershell script

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

Re: Veeam Removal Drive Powershell

Post by veremin » Jan 16, 2017 10:16 am

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: No registered users and 15 guests