Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Post Job commands no longer run

Status
Not open for further replies.

deani

Technical User
Nov 24, 2004
27
0
0
GB
I recently upgraded one of my backup servers from Windows 2000 to 2003. The BAB installation is version 11.1 (Build 3100) as it was before and as it is on our other BAB server (still running W2k)

The problem we are experiencing is this. Prior to the OS upgrade a number of the backup jobs ran post job commands, just simple batch files to reboot a number of servers. However, after the upgrade these jobs no longer run, infact after much testing I can't seem to get anything to run. The job log registers the fact that a post job command has been issued, but just doesn't seem to execute it. Our other BAB server running W2k works fine, no problems.

Any suggestions or ideas are much appreciated.

Ian
 
It may well be an OS rather than an ARCserve issue as several things changed with regard to remote execution between win2k and win2k3.

Firstly, can you run the command successfully outside of ARCserve just from a normal CMD window?
 
Thanks for getting back to me Vschumpy.

It did occur to me that it might be OS related so I have investigated along those lines. I can confirm that the script executes as it should if I run it from a CMD window.

Ian
 
can you pipe the output from the batch file to a text file when it is run so that :

(a) We can see if it actually gets called.

(b) If it gets called, potentially what it fails with.

It would also be useful if you could paste in the lines from the activity log before, during and after the command is run.

Also check the user you run the command as (the user account which you specifically specify in pre/post) to make sure it has sufficient rights to perform the operations in the CMD script.
 
After an hour or so of further testing I'm now really baffled. Either something very strange is happening or it is something so blindingly obvious I can't even see it. Here goes (it might be a little long):

This is the batch file I am trying to execute post job (shutserversbyday.bat):


@echo off
REM Check for passed parameter
if "%1"=="ASBACKUP" goto begin
goto :end
:begin
c:\dayofwk
IF ERRORLEVEL = 7 GOTO :SAT
IF ERRORLEVEL = 6 GOTO :FRI
IF ERRORLEVEL = 5 GOTO :THU
IF ERRORLEVEL = 4 GOTO :WED
IF ERRORLEVEL = 3 GOTO :TUE
IF ERRORLEVEL = 2 GOTO :MON
IF ERRORLEVEL = 1 GOTO :SUN
GOTO END
:sun
echo Sunday
goto :end
:mon
echo Monday
goto :end
:tue
echo Tuesday
shutdown /m \\spinney /f /r
Echo Shutdown
goto :end
:wed
echo Wednesday
goto :end
:thu
echo Thursday
goto :end
:fri
echo Friday
goto :end
:sat
echo Saturday
goto :end
:end
Echo End


The third party executable dayofwk simply returns an errorlevel based on the day of the week.


This is the post job command as entered in the job Option Pre/Post tab, it is executed as a Domain Administrator:

c:\shutserversbyday.bat ASBACKUP > c:\output.txt

Here is the contents of the output.txt file:

3=Tue <<-- This is automatically output by dayofwk.exe
Tuesday
Shutdown
End


And finally this is a portion of the activity log:

Information 22/11/2005 15:27:24 1959 Reschedule Backup Job for 23/11/05 at 11:22.
Information 22/11/2005 15:27:24 1959 Run Command: c:\shutserversbyday.bat ASBACKUP > c:\output.txt.
Information 22/11/2005 15:27:04 1959 136 [CAT ] 4/13/05 11:35 AM [ID:0017,SESSION:136] is merged.(files=1)
Information 22/11/2005 15:27:04 1959 Backup Operation Successful.


Here is the strange part, any other command I substitute instead of shutdown will run, and the output if any written to the output text file. However, whenever I try to run shutdown the result is as above. Note the line Shutdown in the output above is simply coming from the Echo command and not the Shutdown command itself. But this only happens if I am running the batch file as a post job command if I simply run it in a CMD window it executes perfectly.

Any ideas ?

Thanks for all your help.
Ian
 
Ok...call the search off!!!

Finally got to the bottom of it, and as I suspected it was something very obvious and something I should have spotted much much earlier. Our 2003 server didn't have W2k3 SP1 installed. It does now and it works.

Thanks for your help.
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top