cancel
Showing results for 
Search instead for 
Did you mean: 

bpstart_notify not running script command

valor88
Level 3
Partner Accredited

Hi all,

I have a bpstart_notify.policyname.bat script that i want to use to carry out my script commands and mount my drive to be backed up when the policy starts. My script is something like this:

--------------------------------------------------------------------------------------------------

::Open a putty session and execute the command.

plink -ssh -l user1 -pw password -m c:/myscriptlocation/myscript.txt

 

::mount my drive

mountvol f: \\?\volumename\

--------------------------------------------------------------------------------------------------

 

When I run this script on the command prompt manually, it executes perfectly. But when i run the policy and let nbu run the script automatically, it doesn't seem to work properly. Namely, the first command (plink) doesn't happen, and the next command, mountvol runs. 

Seeing that the mountvol command was executed suggests that NBU did indeed execute the script, but i'm unsure of why it was not able to run my plink command.

Any ideas on what the problem might be?

7 REPLIES 7

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Is plink's location present in the PATH env variable? Try with the full path C:\Program files(x86)\Putty\Plink.exe

valor88
Level 3
Partner Accredited

Hi Riaan,

Yes the PATH variable for plink was already added. As mentioned I had no problems running the script in the command prompt manually. Though to answer your question, we already tried with the full path but it didn't work.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Try adding logging to your script so you can see what its doing (or not doing).

mph999
Level 6
Employee Accredited

What happens if you put :

::Open a putty session and execute the command.

plink -ssh -l user1 -pw password -m c:/myscriptlocation/myscript.txt

::mount my drive

mountvol f: \\?\volumename\

... into another script eg. myscript then run it, does that work ?

If it does, then you could then call myscript from bpstart_notify and see if that works.

valor88
Level 3
Partner Accredited
Putting plink in another script doesn't work. Seemed like a good idea though. Im going to try using the CMD /c command and see if it works

Pai-I_Hsieh
Not applicable
Partner Accredited

I have the same question.

I put plink in my parent_start_notify.cmd, it not works. :(
 

valor88
Level 3
Partner Accredited
In the end i gave up and used a scheduler to run the command before the backjob runs. A simple workaround but still doesnt explain why it plink doesnt work though.