-
- Enthusiast
- Posts: 43
- Liked: 7 times
- Joined: Nov 02, 2018 9:13 am
- Contact:
Configure retries on job
Hi,
I can't find the cmdlet to configure the number of retries and wait time for a job.
Please help
I can't find the cmdlet to configure the number of retries and wait time for a job.
Please help
-
- Product Manager
- Posts: 20405
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Configure retries on job
Try this example:
Thanks!
Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your job"
$ScheduleOptions = $Job.GetScheduleOptions()
$ScheduleOptions.Retrytimes = "Number of retries"
$ScheduleOptions.Retrytimeout = "Timeout in minutes"
Set-VBRJobScheduleOptions -Job $Job -Options $ScheduleOptions
-
- Novice
- Posts: 7
- Liked: 1 time
- Joined: Apr 16, 2020 6:02 pm
- Full Name: Justin Pauls
- Contact:
Re: Configure retries on job
This just became useful for me.
dozens of daily jobs, I want to increase and not have to wizard this.
It'd be so nice if we could display / modify job values in a table view inside Veeam BRC directly...
dozens of daily jobs, I want to increase and not have to wizard this.
It'd be so nice if we could display / modify job values in a table view inside Veeam BRC directly...
-
- Novice
- Posts: 7
- Liked: 1 time
- Joined: Apr 16, 2020 6:02 pm
- Full Name: Justin Pauls
- Contact:
Re: Configure retries on job
So I've tried to run a version of that PS script, however I get an error (I'm old hat at KSH / Bash scripts, batch however I'm new to PS).
I've added the snapin, pulled the jobs and can even output the field value I want to change.
When I try and update the $ScheduleOptions.RetryTimes, I get the following error:
I've added the snapin, pulled the jobs and can even output the field value I want to change.
When I try and update the $ScheduleOptions.RetryTimes, I get the following error:
Code: Select all
> echo $ScheduleOptions |select Retrytimes
RetryTimes
----------
3
1
3
1
3
1
3
1
1
1
3
1
1
3
3
Code: Select all
> $ScheduleOptions.RetryTimes = "2"
I'm sure it's probably me, or my syntax.The property 'RetryTimes' cannot be found on this object. Verify that the property exists and can be set.
At line:1 char:1
+ $ScheduleOptions.RetryTimes = "2"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
-
- Veteran
- Posts: 643
- Liked: 312 times
- Joined: Aug 04, 2019 2:57 pm
- Full Name: Harvey
- Contact:
Re: Configure retries on job
Hi Justin,
What was fed into $ScheduleOptions?
You should be able to do something like:
$Job = Get-VBRJob -name 'your job'
$Job.ScheduleOptions.RetryTimes = "1"
$Job.Update()
I have a guess that you maybe just saved some data from somewhere into $ScheduleOptions and you don't have a CBackupJob object there.
For your first output, you've got all your Jobs in there? $ScheduleOptions is an array from Get-VBRJob?
If that's the case, loop over the array and set each one one by one.
Or, you have to call items from the array with $ScheduleOptions[N] where N is the item from the array you want.
If you're trying to set this for all of your jobs, this is pretty simple to loop over, but you're getting the error because what PS is gonna do when you call the property on the Array is just process each item in the array and print the property to the terminal. But you can't apply the change to the object itself.
That's why, as I understand it, you're getting this.
So, instead to set it for all those jobs, do:
What was fed into $ScheduleOptions?
You should be able to do something like:
$Job = Get-VBRJob -name 'your job'
$Job.ScheduleOptions.RetryTimes = "1"
$Job.Update()
I have a guess that you maybe just saved some data from somewhere into $ScheduleOptions and you don't have a CBackupJob object there.
For your first output, you've got all your Jobs in there? $ScheduleOptions is an array from Get-VBRJob?
If that's the case, loop over the array and set each one one by one.
Or, you have to call items from the array with $ScheduleOptions[N] where N is the item from the array you want.
If you're trying to set this for all of your jobs, this is pretty simple to loop over, but you're getting the error because what PS is gonna do when you call the property on the Array is just process each item in the array and print the property to the terminal. But you can't apply the change to the object itself.
$jobs is all my jobs, and $job is a single job.PS C:\Users\Administrator\Desktop> $job.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False CBackupJob System.Object
PS C:\Users\Administrator\Desktop> $jobs.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
That's why, as I understand it, you're getting this.
So, instead to set it for all those jobs, do:
Code: Select all
foreach($Job in $ScheduleOptions){
$Job.ScheduleOptions.RetryTimes = "1"
$Job.Update()
}
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Configure retries on job
Hi Justin,
What Harvey elaborated on is the most likely scenario here. Please let us know, though, if you have any further questions.
Thanks,
Oleg
What Harvey elaborated on is the most likely scenario here. Please let us know, though, if you have any further questions.
Thanks,
Oleg
Who is online
Users browsing this forum: No registered users and 15 guests