ADSM-L

Re: [ADSM-L] prescheduled postcheduled commands help

2007-08-22 12:06:52
Subject: Re: [ADSM-L] prescheduled postcheduled commands help
From: Andrew Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Wed, 22 Aug 2007 10:04:36 -0600
Yep, that is the point of the article to which I pointed the original
poster.

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Product Development
Level 3 Team Lead
Internal Notes e-mail: Andrew Raibeck/Tucson/[email protected]
Internet e-mail: storman AT us.ibm DOT com

IBM Tivoli Storage Manager support web page:
http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageManager.html

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.

"ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> wrote on 08/22/2007
08:23:23 AM:

> Maybe being an ex-programmer, but you have no condition code
> checking to make sure that the NET STOP/START commands completed
> successfully. If you NET STOP's don't work, do you still want to run
> the backup? Now if the last NET STOP command fails, then the
> preschedulecmd will return with a non-zero completion code and the
> backup will not run. Maybe something like this:
>
> REM StartStuff.cmd
>
> Set LASTCC=0
> Set MAXCC=0
> Set LOG_FILE=c:\some\path\StartStuff.log
> Echo Script start at %date% %time% > %LOG_FILE%
>
> Echo Net stop "Update Services" >> %LOG_FILE%
> Net stop "Update Services" >> %LOG_FILE%
> Set LASTCC=%ERRORLEVEL%
> If %LASTCC% EQU 0 goto stop2
> Set MAXCC=%LASTCC%
> Echo Stop of the Update Services service failed with RC=%LASTCC% >>
%LOG_FILE%
> Goto endit
>
> :stop2
> Echo Net stop "World Wide Web Publishing Service" >> %LOG_FILE%
> Net stop "World Wide Web Publishing Service" >> %LOG_FILE%
> Set LASTCC=%ERRORLEVEL%
> If %LASTCC% EQU 0 goto endit
> Set MAXCC=%LASTCC%
> Echo Stop of the World Wide Web Publishing Service failed with RC=%
> LASTCC% >> %LOG_FILE%
> Echo Net start "Update Services" >> %LOG_FILE%
> Net start "Update Services" >> %LOG_FILE%
> :endit
> Echo Script completed at %date% %time% with RC=%MAXCC% >> %LOG_FILE%
> Exit %MAXCC%
>
>
> Now the script will complete with an appropriate return code and
> give you all the messages in case you need to try and figure out
> why it failed.
>
> Bill Boyer
> "I haven't lost my mind...it's backed up on tape somewhere!" - ??
>
>
>
>
> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On
> Behalf Of Andy Huebner
> Sent: Wednesday, August 22, 2007 11:05 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: prescheduled postcheduled commands help
>
> In the dsm.opt file add:
> PRESCHEDULECMD "c:\program files\tivoli\tsm\baclient\StopStuff.bat"
> POSTSCHEDULECMD "c:\program files\tivoli\tsm\baclient\StartStuff.bat"
>  Or
> PRESCHEDULECMD c:\progra~1\tivoli\tsm\baclient\StopStuff.bat
> POSTSCHEDULECMD c:\progra~1\tivoli\tsm\baclient\StartStuff.bat
>
>
>
> In the "c:\program files\tivoli\tsm\baclient" directory add:
>
> StartStuff.bat
>    Net start "Update Services"
>    Net start "World Wide Web Publishing Service"
>
> StopStuff.bat
>    Net stop "Update Services"
>    Net stop "World Wide Web Publishing Service"
>
> Run the backup normally.  The batch has 5 minutes to complete. (I think)
>
> Test both batch files from the command line to make sure there are
> not any dependencies.
>
> I know of no simpler way to stop and start services for a backup.
>
> Andy Huebner
>
> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On
> Behalf Of Lawrence Clark
> Sent: Wednesday, August 22, 2007 9:56 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: [ADSM-L] prescheduled postcheduled commands help
>
> Tim,
>
> It's defined just like your incremental sched, just set
> action=command (default is incremental), then objects=<your script name>
>
> a q sched <sched name> f=d would show:
>
> Policy Domain Name: SPAIX
>                  Schedule Name: STATBKTRACK-FULL
>                    Description: The weekly full backup of selected
tables on
>                                  STATDBMS using SQL-BACKTRACK
>                         Action: Command
>                        Options:
>                        Objects: /home/sybase/dump/dbbkup.s
>
>
>
>
> >>> Timothy.Hughes AT OIT.STATE.NJ DOT US 08/22/2007 11:44:15 AM >>>
> Thanks Lawerence,
>
> I  wasn't aware of that I had planned on  putting the  following
> commands in the dsm.opt file. I have never defined a script
> schedule before I am going to have to figure out the correct syntax
> for this type of script.
> feel free to give example
>
> Tim
>
> pre 'net stop "update service" '
> post 'start " update service" '
> pre 'net stop " World Wide Web Publishing  Service" '
> post ' start " World Wide Web Publishing Service" '
> LANG AMENG
> DOMAIN    ALL-LOCAL
> TCPSERVERADDRESS spf64.oit.state.nj.us
> PASSWORDACCESS GENERATE
> TCPCLIENTADDRESS 10.37.20.54
> NODENAME OITWSUS
> subdir yes
> replace prompt
> tcpb 32
> tcpw 63
> SCHEDMODE    PROMPTED
> txnbytelimit 25600
> errorlogname c:\progra~1\tivoli\tsm\baclient\dsmerror.log
> SCHEDlogname c:\progra~1\tivoli\tsm\baclient\dsmsched.log
> errorlogretention 14
> schedlogretention 7
> tcpnodelay yes
> resourceutilization  3
> LARGECOMMbuffers  yes
> CHANGINGRETRIES    2
> COMPRESSIon       Yes
> BACKUPREG YES
> MANAGEDSERVICES    WEBCLIENT SCHEDULE
>
>
>
>
>
> Lawrence Clark wrote:
>
> >where it is in the dsm.opt shouldn't matter, but since you want to
> stop
> >multiple processes and can only use one -preschedulecmd="my script""
> >you might want to think about defining a schedule that executes a
> >script to stop your processes, does the incremental, then restarts
> >them.
> >
> >
> >Policy Domain Name: SPAIX
> >                 Schedule Name: STATBKTRACK-FULL
> >                   Description: The weekly full backup of selected
> >tables on
> >                                 STATDBMS using SQL-BACKTRACK
> >                        Action: Command
> >                       Options:
> >                       Objects: /home/sybase/dump/dbbkup.s
> >
> >
> >
> >
> >>>>Timothy.Hughes AT OIT.STATE.NJ DOT US 08/22/2007 11:04:57 AM >>>
> >>>>
> >>>>
> >Hello,
> >
> >I need to stop two services before the incremental backup runs then
> >restart the services once the backup completes. I know about the
> >prescheduled and postscheduled commands but have never used them. Where
> >do I insert the commands in dsm.opt file for this to excute
> >successfully? The following are the two services that need to be
> >stopped then restarted once backup completes can someone tell me where
> >I
> would
> >put in the dsm.opt file?
> >The dsm.opt file is below also.
> >
> >
> >1)Update Services
> >2) World Wide Web Publishing Service
> >
> >
> >
> >Thanks in advance for any help!
> >
> >TSM 5.3
> >TSM 5.3.4
> >AIX 5.3
> >
> >
> >
> >LANG AMENG
> >DOMAIN   ALL-LOCAL
> >TCPSERVERADDRESS xxxx.xxx.xxxxxx.xx
> >PASSWORDACCESS GENERATE
> >TCPCLIENTADDRESS xx.xx.xx.xx
> >NODENAME OFSWTUS1
> >subdir yes
> >replace prompt
> >tcpb 32
> >tcpw 63
> >SCHEDMODE   PROMPTED
> >txnbytelimit 25600
> >errorlogname c:\progra~1\tivoli\tsm\baclient\dsmerror.log
> >SCHEDlogname c:\progra~1\tivoli\tsm\baclient\dsmsched.log
> >errorlogretention 14
> >schedlogretention 7
> >tcpnodelay yes
> >resourceutilization  3
> >LARGECOMMbuffers  yes
> >CHANGINGRETRIES   2
> >COMPRESSIon       Yes
> >BACKUPREG YES
> >MANAGEDSERVICES   WEBCLIENT SCHEDULE
> >
> >
> >The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain information that is confidential,
> privileged, and/or otherwise exempt from disclosure under applicable
> law.  If this electronic message is from an attorney or someone in
> the Legal Department, it may also contain confidential
> attorney-client communications which may be privileged and protected
> from disclosure.
> If you are not the intended recipient, be advised that you have
> received this message in error and that any use, dissemination,
> forwarding, printing, or copying is strictly prohibited.  Please
> notify the New York State Thruway Authority immediately by either
> responding to this e-mail or calling (518) 436-2700, and destroy all
> copies of this message and any attachments.
> >
> >
>
>
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain information that is confidential,
> privileged, and/or otherwise exempt from disclosure under applicable
> law.  If this electronic message is from an attorney or someone in
> the Legal Department, it may also contain confidential
> attorney-client communications which may be privileged and protected
> from disclosure.
> If you are not the intended recipient, be advised that you have
> received this message in error and that any use, dissemination,
> forwarding, printing, or copying is strictly prohibited.  Please
> notify the New York State Thruway Authority immediately by either
> responding to this e-mail or calling (518) 436-2700, and destroy all
> copies of this message and any attachments.
>
>
> This e-mail (including any attachments) is confidential and may be
> legally privileged. If you are not an intended recipient or an
> authorized representative of an intended recipient, you are
> prohibited from using, copying or distributing the information in this
> e-mail or its attachments. If you have received this e-mail in
> error, please notify the sender immediately by return e-mail and
> delete all copies of this message and any attachments.
> Thank you.