Host-based backup of VMware vSphere VMs.
Post Reply
homerjnick
Expert
Posts: 212
Liked: 35 times
Joined: Feb 20, 2012 4:13 pm
Full Name: Nick Mahlitz
Contact:

Script After Replication Job Not Running

Post by homerjnick »

Before I log a support call am I missing something here?

My last replication job of the night has a setting to run a batch file that invokes a PowerCLI PowerShell script to shut down all our Veeam Proxies.

Double-clicking the batch file on the Veeam Server does indeed shutdown our Veeam Proxies yet when the replication job finished last night I notice this morning all the Veeam Proxies are still up.

Here is my settings:

Image

The script is on the Veeam B&R server. I'm a bit confused as to why this did not work, heck it is a simple thing, run a batch file on the Veeam server that runs a PowerShell script that simply does a Stop-VM for my Veeam Proxies...all works when I double-click the batch file.

The job results show the script ran successfully:

Image

As I say, these scripts reside on the Veeam B&R...the .ps1 script and the .bat file are in the same folder.


EDIT...I thought I could only use batch files but I notice the dropdown on what type of script you can have and there was a PowerShell one so I've selected my PowerShell script direct and see if that runs tonight. So does that mean you cannot reference other files?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script After Replication Job Not Running

Post by veremin »

If you execute the very same script under Veeam service account, will it work as expected or not? Thanks.
homerjnick
Expert
Posts: 212
Liked: 35 times
Joined: Feb 20, 2012 4:13 pm
Full Name: Nick Mahlitz
Contact:

Re: Script After Replication Job Not Running

Post by homerjnick »

The Veeam Service Account is the same account that I use to RDP to the B&R server and running the script under that is fine..but indeed it must be some sort of permission thing.

I've eliminated the batch file and just execute the PowerShell script after the job so I'll see what happens tonight.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Script After Replication Job Not Running

Post by foggy »

Could it be the non-interactive mode the service uses to perform its tasks? While when you're logged in under the same account, you're working in interactive mode.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script After Replication Job Not Running

Post by veremin »

Only batch and executables are supported as a pre/post-job activities. The option you're talking about just allows you to limit visible scope to files of particular type.

So, if you want to avoid usage of batch file, try the following construction as a post-job activity:

Code: Select all

Powershell.exe -File "Path to your script"
Thanks.
homerjnick
Expert
Posts: 212
Liked: 35 times
Joined: Feb 20, 2012 4:13 pm
Full Name: Nick Mahlitz
Contact:

Re: Script After Replication Job Not Running

Post by homerjnick »

Ok...thanks for that...I've set that for tonight.
homerjnick
Expert
Posts: 212
Liked: 35 times
Joined: Feb 20, 2012 4:13 pm
Full Name: Nick Mahlitz
Contact:

Re: Script After Replication Job Not Running

Post by homerjnick »

foggy wrote:Could it be the non-interactive mode the service uses to perform its tasks? While when you're logged in under the same account, you're working in interactive mode.
This could be the answer as it is still not running.

I see in the logs:

Log has been started by 'SPP-VEEAM\localesxadmin' user (Non-interactive)

If that is the case then the script will not run under that...it runs fine logged in to my Veeam B&R Server as 'SPP-VEEAM\localesxadmin' but that will be in interactive mode.

I'll see if I can reference to run the script under different credentials.
homerjnick
Expert
Posts: 212
Liked: 35 times
Joined: Feb 20, 2012 4:13 pm
Full Name: Nick Mahlitz
Contact:

Re: Script After Replication Job Not Running

Post by homerjnick » 1 person likes this post

Changing the credentials used by referencing a RUNAS has done the trick...
Post Reply

Who is online

Users browsing this forum: No registered users and 82 guests