PowerShell script exchange
Post Reply
karim
Enthusiast
Posts: 29
Liked: 1 time
Joined: Oct 17, 2018 9:01 am
Contact:

job name not updated

Post by karim » Sep 05, 2019 12:34 pm

hello,
i've renamed a backup copy job and i noticed that the ps snappin does not find the job with his new name
i know that veeam does not really rename jobs but is there something to do for updating this ?
(i'm using vb&r 9.5.42866)
thank you

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

Re: job name not updated

Post by veremin » Sep 05, 2019 1:14 pm

Have you re-opened a PS console (just in case)? What script do you use to find a backup copy job? Thanks!

karim
Enthusiast
Posts: 29
Liked: 1 time
Joined: Oct 17, 2018 9:01 am
Contact:

Re: job name not updated

Post by karim » Sep 06, 2019 6:53 am

hello,
yes i have re-opened powershell
i tried directly from the vbr server and remotly from my computer (where the console is installed).

here is the simple code :

Code: Select all

Add-Pssnapin VeeamPssnapin
$JOBNAME = "c_mess_45j"
$restorepoint = Get-VBRBackup -Name $JOBNAME | Get-VBRRestorePoint -Name vm71
with this job name the result is empty, if i try with the old name i can get all the restorepoints

here is the job properties where i can find the old name :

Code: Select all

JobName                          : c_mess_30j 
Name                             : c_mess_30j 
Path                             : c_mess_30j 
DirPath                          : c_mess_30j 
PartialPath                      : c_mess_30j  
Name                     : c_mess_30j.vbm
thank you

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

Re: job name not updated

Post by veremin » Sep 11, 2019 5:28 pm

You're querying previously created restore points, not backup copy jobs. So, the behaviour is expected - previously created restore points have previous backup copy job name. Thanks!

Vek17
Service Provider
Posts: 39
Liked: 10 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: job name not updated

Post by Vek17 » Sep 12, 2019 1:55 pm

You're querying previously created restore points, not backup copy jobs. So, the behaviour is expected - previously created restore points have previous backup copy job name. Thanks!
I want to say that the restore point is not being queried here but the backup which does not have a need or expectation of keeping a historic name as far as I am aware. Restore points are not aware of job names at all and simply pull this information from the backup itself. This job name is also pretty easy to change either through the UI by remapping the backup to to job which updates the job or through power shell to force an update and accomplish the same thing.

Code: Select all

$Backup = (Get-VBRBackup | Where-Object {$_.ID -eq 'B5F074C4-1598-4C1B-ADDF-2B021B12E95A'})
$Backup.Update($Backup.GetJob())
In either case I'd call this poor naming of the field at best or unexpected behavior at worst since the job_name would reasonably be expected to reflect the current job name, or in the case of an unmapped backup the job_name of the last thing it was assigned of.

That being said the easiest workaround to query by job name now is to actually query for the job and then get the backup from the job instead of just asking for the backup but that is not something that is clear by documentation

Code: Select all

(Get-VBRJob -Name 'Example Backup Name').FindLastBackup()

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest