Networker

Re: [Networker] Problems running pre/post cmds

2010-12-10 16:38:32
Subject: Re: [Networker] Problems running pre/post cmds
From: "Browning, David" <DBrown AT LSUHSC DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 10 Dec 2010 15:37:34 -0600
Sorry, I said stop SQL, but we really stop 3 custom services from
inserting records into the SQL database, so that we can backup the
database.  Otherwise, the record insertions and backups running at the
same time just overwhelm the server. 

David M. Browning Jr.
IT Project Coordinator Enterprise Backups and Help Desk

 

-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On
Behalf Of Browning, David
Sent: Friday, December 10, 2010 3:32 PM
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: Re: [Networker] Problems running pre/post cmds

Here's an example that we use for one of our SQL servers.   The server
is being hit so intensively that we have to stop SQL to backup the
database.  Each start/stop sends output to a log file. A total of 4
files:

Savegroup.res
Pre-cmd.cmd
Sql.bat
Post-cmd.cmd

Details of each file. 

savegroup.res
type: savepnpc;
precmd: "C:\pre-cmd.cmd";
pstcmd: "C:\post-cmd.cmd";
abort precmd with group: No;

Then, in the root directory (so that we don't have to fool around with
path statements). 

Pre-cmd.cmd (stop 3 services, then run SQL command)
NET STOP EvtLogD > C:\precmdresult_stopD.txt 2>&1
NET STOP EvtLogH > C:\precmdresult_stopH.txt 2>&1
NET STOP EvtLogS > C:\precmdresult_stopS.txt 2>&1
C:\sql.bat

SQL.BAT
CD c:\program files\legato\nsr\bin
nsrsqlsv -v -b SQL -g savegroupname -l full -s bacckupservername MSSQL:

post-cmd.cmd
NET START EvtLogD > C:\postcmdresult_startD.txt 2>&1
NET START EvtLogH > C:\postcmdresult_startH.txt 2>&1
NET START EvtLogS > C:\postcmdresult_startS.txt 2>&1

Hope this helps! 

David M. Browning Jr.
IT Project Coordinator Enterprise Backups and Help Desk

 
-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On
Behalf Of Michael Leone
Sent: Friday, December 10, 2010 1:24 PM
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: [Networker] Problems running pre/post cmds

NW 7.5.2, Win2003 (server), Win2008 R2 (client).

I am trying to run a client backup that requires a pre-save command to 
stop a database, and a post command to start the database services. Not 
unusual, right?

I created a file "Special Jobs Run.res" on my client's res folder
folder. 
Put this in there:

type: savepnpc;
precmd: "C:\\PHA_Scripts\\SuspendSourceOne.CMD";
pstcmd: "C:\\PHA_Scripts\\ResumeSourceOne.CMD";
timeout: "12:00:00";
abort precmd with group: No;

And the file "C:\PHA_Scripts\SuspendSourceOne.CMD" says:

ECHO "Job start - %DATE% %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
ECHO "Stopping Archive %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
Cscript C:\PHA_Scripts\ES1_NativeArchiveSuspend.vbs
ECHO "Stopping Activity %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
Cscript C:\PHA_Scripts\ES1_ActivitySuspend.vbs

However, when running the job, the server reports:

1 retry attempted
32476:savepnpc: Unable to run preclntsave for group Special Job Runs 
successfully, see savepnpc.log for possible causes.

That log (on the client) says:
12/10/2010 1:53:57 PM preclntsave: Starting up the precmds.
12/10/2010 1:53:57 PM preclntsave: No commands specified to be run.
12/10/2010 1:54:03 PM preclntsave: Starting up the precmds.
12/10/2010 1:54:03 PM preclntsave: No commands specified to be run.


And I have no idea why it thinks there are no commands specified to run,

since I clearly have "precmd: "C:\\PHA_Scripts\\SuspendSourceOne.CMD";"
in 
the res file of the group on the client. And it uses 2 slashes, as the 
delimiters, as the Admin Guide requires. And I have explicitly specified

execution paths, since these types of jobs don't inherit environments (I

think I remembered that right). And the "SuspendSourceOne.CMD" script 
works perfectly from a normal command prompt. But it never seems to 
execute when Networker runs the job.

What am I doing wrong here?


-- 
Michael Leone
Network Administrator, ISM
Philadelphia Housing Authority
2500 Jackson St
Philadelphia, PA 19145
Tel:  215-684-4180
Cell: 215-252-0143
<mailto:michael.leone AT pha.phila DOT gov>

To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems with this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems with this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER