Networker

Re: [Networker] SAVEPNPC question about precmd in a Windows environment

2012-02-18 14:10:26
Subject: Re: [Networker] SAVEPNPC question about precmd in a Windows environment
From: jee <jee AT ERESMAS DOT NET>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Sat, 18 Feb 2012 19:09:16 +0000
Hi Michael,

are you using the following syntax

 "cmd /c  /path/to/script"

on your savepnpc commands?

jee


On Friday 17 Feb 2012 15:49:23 Michael Leone wrote:
> There's something really not right here. Here is my precmd script:
> 
> ----------------------------------------
> ECHO "Job (suspend) starting - %DATE% %TIME%"
> 
> >>"C:\PHA_Scripts\logs\Suspend.log"
> 
> ECHO "Suspending Activity %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
> C:\Windows\SysWOW64\CSCRIPT.EXE "C:\PHA_Scripts\Source1
> Scripts\ES1_ActivitySuspend.vbs"
> 
> ECHO "Suspending Archive %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
> C:\Windows\SysWOW64\CSCRIPT.EXE "C:\PHA_Scripts\Source1
> Scripts\ES1_NativeArchiveSuspend.vbs"
> ECHO "Job (suspend) end - ACTIVITY/ARCHIVING suspended ..... - %DATE%
> %TIME%" >>"C:\PHA_Scripts\logs\Suspend.log"
> 
> C:\PHA_Scripts\blat C:\PHA_Scripts\Logs\Suspend.log -to
> Michael.Leone AT pha.phila DOT gov -subject "SourceOne Suspend Log"
> ----------------------------------------
> 
> So it writes out lines to a log; calls out and executes a vendor-provided
> Visual Basic script; writes out more log lines; executes the second vendor
> provided Visual Basic writes out some final log lines; and then emails me
> the log.
> 
> Now, when I execute this command from the command line on my client, it
> takes about 5 minutes total to execute, since those 2 VB scripts take a
> while. Works perfectly - if I look at Source One after the script runs, it
> properly shows status as "PAUSED".
> 
> Yet, when I call the above script as a precmd from Networker, I get this
> emailed to me:
> 
> "Job (suspend) starting - Fri 02/17/2012 15:30:31.66"
> "Suspending Activity 15:30:31.66"
> "Suspending Archive 15:30:32.00"
> "Job (suspend) end - ACTIVITY/ARCHIVING suspended ..... - Fri 02/17/2012
> 15:30:32.39"
> 
> So this tells me that the 2 VB scripts aren't executing at all, since the
> log lines are written 0.35 seconds apart ...
> 
> But why aren't they executed? They execute just jim dandy fine from the
> command line; it's only when Networker execute this script as a precmd
> that it does nothing..
> 
> Ideas, anyone? When I get back in on Tue, I will be calling EMC Tech
> Support, but I'd really like to figure out why. Permissions? How can I
> determine that, or get around it? Networker executes as LOCAL SYSTEM (the
> default) on the client.
> 
> > From: Michael Leone <Michael.Leone AT PHA.PHILA DOT GOV>
> > To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
> > Date: 02/17/2012 03:09 PM
> > Subject: [Networker] SAVEPNPC question about precmd in a Windows
> 
> environment
> 
> > Sent by: EMC NetWorker discussion <NETWORKER AT LISTSERV.TEMPLE DOT EDU>
> > 
> > So I've come to the point where I need to do a customized backup (in my
> > case - pause a database system - EMC's SourceOne mail archiving program
> 
> -
> 
> > back it up, then resume those services). I have a small script that
> > actually pauses the database, and another that restarts it,. So these
> 
> are
> 
> > the commands I will be putting in the precmd/pstcmd fields in the
> > group-name.res file that is created by the initial run of savepnpc. So
> 
> far
> 
> > so good. But the documentation talks about "The command environment that
> > 
> > is opened by the savepnpc command to run a
> > customized backup does not automatically inherit the system?s default
> > environment". Fine; so on the precmd I will put the full path to my
> 
> script
> 
> > (c:\scripts\stop-it.CMD), and similarly for the pstcmd, so it can be
> > found.
> > 
> > But: that restriction doesn't apply to the 2 scripts themselves, does
> 
> it?
> 
> > My "stop-it.CMD" and "start-it.CMD" scripts will get a normal default
> > environment, including resident commands like "time" and "date"? My
> > scripts write out a log file, using the resident time/date commands as
> > timestamping, and mail me the log when each script finishes.
> 
> 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