Comprehensive data protection for all workloads
Post Reply
rilot
Lurker
Posts: 2
Liked: never
Joined: Apr 25, 2013 3:23 pm
Full Name: Andy Riley
Contact:

Help with pre-freeze and post-thaw scripts.

Post by rilot »

Hi
I've got an environment where I want to use Veeam as the backup tool but I'm having issues with a non VSS aware application and pre-freeze scripts.
Essentially, I need to freeze an old Oracle database and SAP system on a Windows 2003 box but the issue I have is that the shutdown scripts need to be run as a specific user. From what I can tell, Tools executes the pre-freeze script as the local system user.

How can I execute pre-freeze scripts in shutdownScripts.d as a specific user? I've tried calling the external scripts using psexec.exe to pass a username and password across but they aren't working. They are definately being called because I added an ECHO to a txt file to prove that just now.

Strangely, they do work when I call them directly from the command line and pipe "freeze" to them.

This is my script:

Code: Select all

if "%1%" == "freeze" goto doFreeze
if "%1%" == "thaw" goto doThaw
goto EOF

:doFreeze
psexc.exe -u <domain>\<username> -p <password> call <path_to_script>\script1.bat
goto EOF

:doThaw
psexc.exe -u <domain>\<username> -p <password> call <path_to_script>\script2.bat
goto EOF

:EOF
veremin
Product Manager
Posts: 20406
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help with pre-freeze and post-thaw scripts.

Post by veremin »

What if you try to use runas command?

For passing password to runas command you should utilize /savecred option that uses previously saved credentials. Add credentials via the credential manager in Control panel, and then run the corresponding batch file, using runas with a /savecred option.

Hope this helps.
Thanks.
rilot
Lurker
Posts: 2
Liked: never
Joined: Apr 25, 2013 3:23 pm
Full Name: Andy Riley
Contact:

Re: Help with pre-freeze and post-thaw scripts.

Post by rilot »

Perfect. Thanks.
We're actually going with another method that I thought up last night.

We're going to set up two jobs in Windows scheduled tasks (which can be run as elevated users) and call them to run with the /NOW switch. By default they will have no specified run time.

Script will look like this:

Code: Select all

if "%1%" == "freeze" goto doFreeze
if "%1%" == "thaw" goto doThaw
goto EOF

:doFreeze
schtasks /run /tn "freeze-task" -u <domain>\<username> -p <password>
goto EOF

:doThaw
schtasks /run /tn "thaw-task" -u <domain>\<username> -p <password>
goto EOF

:EOF
veremin
Product Manager
Posts: 20406
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help with pre-freeze and post-thaw scripts.

Post by veremin »

We're going to set up two jobs in Windows scheduled tasks (which can be run as elevated users) and call them to run with the /NOW switch
Might do the trick.

Anyway, give both of the solutions a shot and see whether everything works as expected.

Thanks.
kefoster
Novice
Posts: 8
Liked: 2 times
Joined: Jun 21, 2012 7:34 pm
Full Name: Kevin Foster
Contact:

[MERGED] VMware Tools quiescence pre & post script user

Post by kefoster »

We are writing a script to stop Clearcase vobs and then restart them. We have it all working outside of veeam and VMware but we need it to run it as a specific user. Is it possible to select a user for it to run as in veeam or does anyone else have any ideas?

Thank you,

Kevin Foster
jackycheung
Lurker
Posts: 2
Liked: never
Joined: May 03, 2013 9:39 am
Contact:

[MERGED] VMware Tools quiescence pre & post script user

Post by jackycheung »

What is the default account used for running the pre-freeze/post-thaw scripts?
I am trying to get the pre-freeze/post-thaw scripts to stop/start a service (on Windows) before/after the backup but it would not work as stopping/starting services requires elevated access. And the Runas command would prompt for password if trying to runas /user:administrator. Any suggestions?
veremin
Product Manager
Posts: 20406
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help with pre-freeze and post-thaw scripts.

Post by veremin »

As mentioned above, you can use either runas command in conjunction with /savecred option or Windows Scheduled tasks.

Hope this helps.
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 293 guests