Comprehensive data protection for all workloads
Post Reply
erickson
Enthusiast
Posts: 27
Liked: 2 times
Joined: Feb 16, 2016 7:34 am
Full Name: matei sebastian Alin
Contact:

Post and pre scripts not working

Post by erickson »

Hello, i have a problem with post and pre scripts in veeam b&r 9.5 .
I have 2 simple scripts! One that lunch richcopy from a cmd file:

Code: Select all

"C:\Program Files (x86)\Microsoft Rich Tools\RichCopy 4.0\RichCopy64.exe" "\\veeamrm\e$\Backups\Backup Domenica x Tape Roma"  "D:\Roma" /FSD /NE /P /US /UD 
this report that script exit with code 3 and if lunched mannualy it runs!
and another one that non report anything and not working either manually and is not giving any error in powershell ide:
cmd:

Code: Select all

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -Noninteractive -File "C:\Scripts\roma.ps1"
roma.ps1 :

Code: Select all

Add-PSSnapin "VeeamPSSnapIn"
Get-VBRJob -Name "ROMAtoTAPE" | Start-VBRJob -FullBackup
erickson
Enthusiast
Posts: 27
Liked: 2 times
Joined: Feb 16, 2016 7:34 am
Full Name: matei sebastian Alin
Contact:

Re: Post and pre scripts not working

Post by erickson »

For the powershell script i found out that i have to use Get-VBRTapeJob for tape job but if i lunch it mannualy without administrator priviledges i get Start-VBRJob : Access denied.

I didn't test it yet with post script!
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post and pre scripts not working

Post by veremin »

Correct, you have to use Get-VBRTapeJob to return tape jobs. Also, -FullBackup switch is not needed (it doesn't do anything for tape jobs). Administrator permissions are also necessary, so make sure that account under which the scripts are executed doesn't lack those.

Thanks.
erickson
Enthusiast
Posts: 27
Liked: 2 times
Joined: Feb 16, 2016 7:34 am
Full Name: matei sebastian Alin
Contact:

Re: Post and pre scripts not working

Post by erickson »

Where i choose the account? The account that Veeam runs is SYSTEM.
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post and pre scripts not working

Post by veremin »

I meant either manual or scheduled (say, Task Scheduler) script execution, where it's possible to run scripts under different accounts. Thanks.
erickson
Enthusiast
Posts: 27
Liked: 2 times
Joined: Feb 16, 2016 7:34 am
Full Name: matei sebastian Alin
Contact:

Re: Post and pre scripts not working

Post by erickson »

Ok i know this bu how do i start a script just before or after the job start?
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post and pre scripts not working

Post by veremin »

1) Either execute a required job within the script, between pre and post activities of your choice. Schedule this script via Task Scheduler.
2) Or set scripts as pre and post job activities in backup server UI. Make sure Veeam service account does not lack necessary permissions
Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], Semrush [Bot] and 117 guests