Automated archive description with date

robbenleaf

ADSM.ORG Member
Joined
Mar 17, 2003
Messages
26
Reaction score
0
Points
0
Website
Visit site
I have set up an automated archive schedule, and would like to give the archives a description (per the Description option) that includes an embedded date. The default archive description includes the system date; how do I pull that information as a variable and include it in my own description? What's the syntax?



Example of options line: -archmc=7year -subdir=yes -description=OracleDBArchiveMMDDYY
 
Robben,

This depends on what OS your client is on, I will include examples for both NT/2000/XP and Unix:



NT:

create a .cmd file that contains this:



@echo off

FOR /f "tokens=2-4 delims=/ " %%a in ('DATE/T') do SET date=%%a-%%b-%%c

for /F "delims=" %%a IN ('time /t') DO set TIME=%%a

cdprogra~1tivolitsmbaclient

dsmc arch filespec

-desc="Oracle DB Archive %DATE% %TIME%"

-archmc=7year

-subdir=yes

exit



In Unix (for Korn shell) :

write a script .sh that includes :



#/bin/ksh!

DATE=$(date)

dsmc arch filespec

-archmc=7year

-subdir=yes

-description="OracleDBB $DATE"

exit



obviously you will not put each -option on a new line (must be a single line) but this will achieve your goal.



Cheers!

Brandon
 
I noticed I put



#/bin/ksh! date=$(date)



that should be



#/bin/ksh!

date=$(date)





sorry about that.
 
Back
Top