Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting Tivoli Storage Manager 2

Status
Not open for further replies.

phorbiuz

Technical User
Jul 22, 2004
67
GB
Hi

Hope I'm in the right forum here as its a combination of TSM and scripting on AIX.

What I'm looking at doing is using a TSM macro file containing the list of commands I want to run. The command takes the format:

dsmadmc -id=(user id) -pa=(password) -itemcommit macro /tmp/tsm_macro_file.txt

The macro file itself would contain lines such as:

q event * * begindate=today-1
q vol * access=readwrite,readonly status=full,filling stgpool=offsite
q vol * access=readwrite,readonly status=full,filling stgpool=offsite_oracle

etc etc

The problem I'm having is getting a script to use these commands in turn using the read command.

If I set it up as follows:

pg /tmp/tsm_macro_file.txt | while read COMMAND; do
echo ${COMMAND}
done

It treats the * symbol of the command as a wildcard and lists every file in its working directory, which I obviously don't want.

If I have the macro file set up using backslash as follows:

q event \* \* begindate=today-1

Then the read command reads the line exactly as its read above without the wildcard interpretation, but it also passes it to TSM that way which equally doesn't work.

Anyone any suggestions please?


 
Sorry, I've found the unix scripting forum, but I can't find a way to move this post to there.....

 
I'm not sure if this will help but what if you try using the eval?

pg /tmp/tsm_macro_file.txt | while read COMMAND; do
echo ${COMMAND}
done

keeping this the same:

q event \* \* begindate=today-1

Regards,
Khalid
 
Not sure how this fits in with your original question, but:

while read COMMAND </tmp/tsm_macro_file.txt; do
echo [red]"[/red]${COMMAND}[red]"[/red]
done

The quotes prevent the shell from expanding the wildcard characters in your TSM command lines.

And no need to pg the file and piping the (paged) output to "while read", just redirect stdin for "while read" from your file.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top