PowerShell script exchange
Post Reply
arosas
Enthusiast
Posts: 41
Liked: 6 times
Joined: Jun 09, 2015 9:33 pm
Full Name: Tony Rosas
Contact:

Post Job Script

Post by arosas » Dec 13, 2019 8:03 pm

Logs show the post script runs successfully (EXIT CODE 0) but the actions of the script do not actually happen. If I run the script manually it runs fine from the Veeam server, under the Veeam service account so we know it's not service account related.

Configured in BACKUPJOB1 job settings>guest processing>applications>scripts
Pre Freeze script: (pre freeze script works and we see these actions happen on the application server)
It stops services on the application servers APPSERVER1 and APPSERVER2.
Once services stop, script moves some log files from one location to another with no issues.

Post Thaw script: (Post thaw script works and we see the action happen)
Starts services on application servers APPSERVER1 and APPSERVER2.

We then combined both scripts from pre freeze and post thaw into one script. We run it manually from the Veeam server under the service account and we can see the expected actions happen on the application servers.

We configure the same BACKUPJOB1 with a job end script found in job settings>storage>advanced>scripts with the combined script. We only check "Run the following script after the job:' and the radio button for "run scripts every 1 backup session is selected"

The logs show the script ran successfully but the actions are not performed, the expected actions are stopping, starting services or moving log files on the application servers.
Any ideas?

I already opened a support request but doesnt sound like it's something they want to help with even though we know the script is successful, just need help investigating the actual execution of the script.
Case # 03909777

oleg.feoktistov
Veeam Software
Posts: 85
Liked: 29 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Post Job Script

Post by oleg.feoktistov » Dec 13, 2019 11:28 pm

Hi Tony,

Can you, please, share the exact script you use as a post-job activity?

Thanks!
Oleg

soncscy
Enthusiast
Posts: 47
Liked: 17 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey Carel
Contact:

Re: Post Job Script

Post by soncscy » Dec 15, 2019 12:42 pm

Heya Tony,

I think an easy way to check such things is just throw some dummy debug steps into your script, like write to some file in C:\temp before and after your steps.

Pre-freeze/post-thaw scripts are run by your Guest Processing account, iirc, so you need to check it with the account you've set in the Guest Processing section with a non-interactive login. For previous issues I had with another client (this was postgresql, but still), it's because Postgresql didn't handle the non-interactive login correctly, and you might wanna look into if MSSQL has similar issues, or some GPO doing something similar that forces an interactive login.

Basically, our experience with Veeam and scripts has always been that the app is pretty hands-off; if Windows gives a 0 exit code, something in Windows is causing this, and it's your script that needs to be edited. As long as you know it's a non-interactive login and also with the Guest Processing account, you can know what to test/explore. It doesn't sound like you have a Veeam issue at all, you have a Windows issue to solve.

oleg.feoktistov
Veeam Software
Posts: 85
Liked: 29 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Post Job Script

Post by oleg.feoktistov » Dec 17, 2019 11:45 am

Tony, I just thought - have you configured implicit remoting to the corresponding application servers in your post-job script?
When you set scripts under Storage advanced settings, they are being executed on the Backup server by default as mentioned here.
Thanks! Oleg

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests