I see in your script that you disable VMware jobs after Oracle RMAN jobs but not vice versa. Anyway, could you please clarify what exactly is not working: the job remains in running state or do you see an error message? Do you encounter the issue every time when you try to stop the job or it works sometimes?
Hi PetraM,
Thank you for the reply.
I need to stop all the jobs before doing windows update.
1.When I run full script it stops "Oracle RMAN Job" but doesn't go to next step which is to stop "Vmware Job".
2.I encounter issue each time.
3.If I run those two script (One for Oracle and another for Vmware) seperately, it stops the both job that means; there is no problem with the individual script.
I am getting this error message:
Backup job session:
Job "BCJ Production 1 2 3 & 2008 '0' of '0' bytes processed, object '0' of '0', 00:00:00 remaining, Files remaining\total: 0 B; Avg. rate:0 KB/s
I think your issue is very likely that the job is still stopping.
Your script logic has a flaw in that it assumes a job for sure stops after 30 seconds, which is not guaranteed. You should instead issue the stop command as you do, then check the status in a loop with Get-VBRJob | Where-Object {$_.IsRunning -ne $false}. If anything is returned by this, then you should re-issue the wait command.
You will probably want to build a counter into it for every minute and I'd say if the job hasn't stopped after 30 minutes, the script should break there and send a message that you need manual intervention, because something is preventing the job from stopping gracefully and it needs a human decision at that point.
Thank you, soncscy.
It is working but taking very long time to disable the backup copy job. It is taking more than 2 hours to disable the back up copy job.
Do you see the same problem if you disable the job not from the script, for example manually? If this is the case, I'd suggest to open a support request.
Hi Oleg, Petrm
I can disable manually and my script stops them as well but it is just taking more than 2 hours to stop the job.
We are trying to stop and disable all jobs before we are doing our regular windows update.
Currently, we are doing everything manually, we are trying to stop Veeam with the script so it can be automated before doing Windows update.
Does it take more than 2 hours to stop all jobs or just a specific one? And mind me asking whether there is an option to reschedule Windows updates so that to install them out of backup window, when there are no jobs running per schedule?
Well, let's try to understand why does stop of backup copy job take more than 2 hours, please open a support request and share case ID with us.
Nevertheless, I'd appreciate it if you had time to review another question above: is there an option to reschedule Windows updates so that to install them out of backup window, when there are no jobs running per schedule?
Thank you PetrM,
We have decided to reschedule the backupcopy job and disabled during windows patching time. So, we don't need to stop it through powershell script.