Hi Michael,
hereby included you'll find the VBscripts that we're using
for doing TSM backups. Note that if you think to use them
you'll have to install WSH 5.6.
Regards,
--Jean-Baptiste
------------------------------- TSMbck_incr_NTPDC.wsf ----------------
------------------------------- TSMbck_incr_NTPDC.wsf ----------------
<job id="TSMbck_incr_NTPDC">
<job id="TSMbck_incr_NTPDC">
<script language="vbscript" src="C:\PROD\global\exe\BaseName.vbs"/>
<script language="vbscript">
dim FSO, LOGFILE, WSHSHELL
dim ENVIR, APPDRIVE, APPEXE,APPFIL,APPLOG,APPDAT,APPLIC
dim THOUR, TDAY
const ForReading = 1, ForWriting = 2, ForAppending = 8
APPDRIVE = "C:\"
ENVIR = "PROD"
APPLIC = "tsm"
APPEXE = APPDRIVE & ENVIR & "\" & APPLIC & "\exe\"
APPFIL = APPDRIVE & ENVIR & "\" & APPLIC & "\fil\"
APPLOG = APPDRIVE & ENVIR & "\" & APPLIC & "\log\"
APPDAT = APPDRIVE & ENVIR & "\" & APPLIC & "\dat\"
APPTMP = APPDRIVE & ENVIR & "\" & APPLIC & "\tmp\"
SCP_FNAME = wscript.scriptfullname
SCP_NAME = BaseName( SCP_FNAME )
THOUR = replace ( time , ":" , "" )
TDAY = replace ( date , "/" , "" )
set FSO = createobject("scripting.filesystemobject")
set WSHSHELL = wscript.createobject("wscript.shell")
set LOGFILE = FSO.createtextfile( APPLOG & SCP_NAME & "_" & TDAY & THOUR &
".txt", true)
LOGFILE.writeline("Script " & SCP_NAME & " started on: " & date & " " &
time)
LOGFILE.writeline("")
REM
------------------------------------------------------------------------------------
REM --- Start of script job. Put your commands below...
REM --- Start of script job. Put your commands below...
REM
------------------------------------------------------------------------------------
Do_Backup
Do_Backup
sub Do_Backup()
dim TSMDIR,TSMEXE,TSMOPT,TSMCMD
TSMDIR="c:\program files\tivoli\tsm\baclient"
WSHSHELL.currentdirectory=TSMDIR
TSMDIR="c:\program files\tivoli\tsm\baclient"
WSHSHELL.currentdirectory=TSMDIR
TSMEXE="""c:\program files\tivoli\tsm\baclient\dsmc.exe"""
TSMOPT="-id=xxxxx -password=xxxxx"
TSMCMD="incr"
RC=WSHSHELL.run(TSMEXE & " " & TSMOPT & " " & TSMCMD,0,true)
if RC<>0 then
LOGFILE.writeline( SCP_NAME & ": ERROR --- dsmc.exe exited with RC=" &
RC & ". ---")
else
LOGFILE.writeline( SCP_NAME & ": INFO --- dsmc.exe exited with RC=" &
RC & ". ---")
end if
end sub
REM
------------------------------------------------------------------------------------
REM --- End of script job.
REM --- End of script job.
REM
------------------------------------------------------------------------------------
LOGFILE.writeline("")
LOGFILE.writeline("")
LOGFILE.writeline("Script " & SCP_NAME & " ended on: " & date & " " &
time)
</script>
</job>
------------------------------end TSMbck_incr_NTPDC ------------
------------------------------------ Basename.vbs --------------
------------------------------------ Basename.vbs --------------
function BASENAME(FNAME)
function BASENAME(FNAME)
dim FSO
set FSO = createobject("scripting.filesystemobject")
BASENAME = FSO.getbasename(FNAME)
end function
|