ADSM-L

SV: Help on a TSM bat file for NT

2002-08-05 07:16:13
Subject: SV: Help on a TSM bat file for NT
From: Bo Nielsen <Bo_Nielsen AT FDB DOT DK>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 5 Aug 2002 13:10:47 +0200
Hi Rob,

try this script, it's work for me:

***********BEGIN****************************
@echo off
rem Batch file to archive files
rem 08/01/2001 Bo Nielsen.

set drive=D:
set adsm_dir=progra~1\tivoli\TSM
set adsm_cmds=COMMAND
set adsm_back=BaClient
set log_file=Archive.LOG
set archivelog=%drive%\%adsm_dir%\%log_file%

:find_dato

Rem Creates a file containing ddd dd
FOR /F "delims=- tokens=1" %%A IN ('DATE /T') DO ECHO %%A >%TEMP%\DATE.TMP
Rem Extract dd from DATE.TMP
FOR /F "tokens=2" %%A IN (%TEMP%\DATE.TMP) DO SET DAYNUM=%%A

FOR /F "delims=- tokens=2" %%A IN ('DATE /T') DO SET MTH=%%A

FOR /F "delims=- tokens=3" %%A IN ('DATE /T') DO ECHO %%A >%TEMP%\Year4.tmp
FOR /F %%B IN (%TEMP%\Year4.tmp) DO SET YEAR4=%%B

ECHO Date (yyyy-mm-dd) = %MTH%/%DAYNUM%/%YEAR4% >%TEMP%\mmddyy.tmp
FOR /F "tokens=4" %%A IN (%TEMP%\mmddyy.TMP) DO SET dato=%%A

:SQLBackup

CD /d %drive%\%adsm_dir%\%adsm_back%

rem Archive E:\IISLogFiles

rem dsmc ARCHIVE E:\iislogfiles -subdir=yes -DELetefiles
-DEscription="Archive Date: 07/31/2001 IISLogFiles"
dsmc ARCHIVE E:\iislogfiles\* -subdir=yes -DELetefiles -DEscription="Archive
Date: %dato% IISLogFiles"

:exit

exit
***********END****************************


        Regards,
        Bo Nielsen

        COOP Danmark a/s                     Phone: +45 4386 4671
        Roskildevej 65                             Fax:     +45 4386 4990
        DK-2620 Albertslund                   E-mail: bo_nielsen AT fdb DOT dk
        Denmark

-----Oprindelig meddelelse-----
Fra: Rob Hefty [mailto:R.Hefty AT LABSAFETY DOT COM]
Sendt: 31. juli 2002 22:15
Til: ADSM-L AT VM.MARIST DOT EDU
Emne: Help on a TSM bat file for NT


Hello All,

I am attempting to create a bat file that will automate an archive for some
data on the NT/Win2k platform.  What I am having difficulty with is passing
the date variable into the description.  So far I have:

D:
:SETVAR
set date/t=dates
 Cd D:\Program Files\tivoli\tsm\baclient\
dsmc Archive -archmc=36-MONTH-ARCHIVE -desc="Freight Archives for Monthend
Prior to: %dates%" D:\temp\test\*
pause 5

When it completes it runs the archive fine only the description is lacking a
date stamp.  Any suggestions would be appreciated.


Thanks,
Rob Hefty
IS Operations
Lab Safety Supply