PowerShell script exchange
Post Reply
Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 19, 2013 10:21 am

Hi All,

I need to create a Job to export my backup on a USB Hard Drive, so i created a Job with file copy, but i would like to have the inventory of all backup in this export.

I think it's possible to launch a powershell script at the end of the export Job to list all restore point with the name of the .vmdk or the name + the description of the backup job and at the end of this script, i would like delete all backup in the veeam 'database' who have been copied.

For the moment i have the liste of the VM + the date of creation and the type (increment or full) (thanks to tsightler for this line of powershell)

Code: Select all

Get-VBRBackup -Name "<JobName>" | Get-VBRRestorePoint | Sort Name,@{Expression = {$_.CreationTime}; Ascending = $false}
Thanks in advance
Best Regards,
Christophe

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 10:17 am

The description of a given job can be gotten this way:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -Name "Name of a Backup Job" 
$Job.Description
i would like delete all backup in the veeam 'database' who have been copied.
So, you're trying to delete from Veeam Database any reference to restore points that have been already copied to USB Hard Drive, arent' you?

Thanks.

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 11:54 am

Thanks v.Eremin for your reply,
So, you're trying to delete from Veeam Database any reference to restore points that have been already copied to USB Hard Drive, arent' you?
Yes,

when i try

Code: Select all

$Job = Get-VBRBackup -Name "backup1" 
$Job.Description
i have nothing, but the first line works.
do you know why ?

Thanks in advance,

Best Regards,
Christophe

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 12:04 pm

i have some informations in the description field ... stange

Christophe

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 12:05 pm

There must have been a typo in the line I provided. It’s Get-VBRJob that should be used instead of Get-VBRBackup:

Code: Select all

$Job = Get-VBRJob -name "Name of your Backup Job"
$Job.Description 
Thanks.

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 12:13 pm

Perfect, thanks a lot !

I'm searching to remove the backup who as copied, do you know how i can do it ?

Thanks in advance,
Best Regards,
Christophe

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 12:44 pm

I'm searching to remove the backup who as copied, do you know how i can do it ?
Acctually, the process of restore points deletion should be handled solely by the specified retention policy. Otherwise, you will face numerous issues of failing backup/replication jobs, etc.

Thanks.

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 12:47 pm

and if i delete it manually ?

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 1:01 pm

As mentioned, it’s retention policy that should be responsible for deleting of restore points. Manual deletion will lead to failing backup jobs. Thanks.

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 1:09 pm

ok thanks,
this could be a problem, because i need to export all backup each month ...

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 1:32 pm

What backup mode is being used? Reversed or Forward incremental on?

If it’s reversed method that is being leveraged, you can set retention policy to 1 in the end of the script and the following job run will delete all previous restore points.

Thanks.

Christophe7982
Novice
Posts: 7
Liked: never
Joined: Jul 19, 2013 9:52 am
Full Name: Christophe Quarré
Contact:

Re: List Restore Point With Job Description Or Name .vmdk

Post by Christophe7982 » Jul 22, 2013 1:50 pm

it's incremental with one full by month

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

Re: List Restore Point With Job Description Or Name .vmdk

Post by veremin » Jul 22, 2013 2:10 pm

In this case, you might want to set (within the script) retention policy to 2 and run the script the day before active full takes place. Thus, after first incremental run previous restore points (that have been already copied to external device) will be deleted.

In fact, you can set retention policy to 1, instead, and this guarantees that previous restore points will be deleted once full backup is created. However, I advice you against, since such specification (1 restore points to keep) might lead to unexpected consequences should the job be retried.

Thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests