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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bpexpdate 1

Status
Not open for further replies.

YouEnjoyMyself

IS-IT--Management
Jul 27, 2004
111
0
0
US
I need to make up a perl script or a shell script for windows that runs the following command on a list of tapes:

"bpexpdate -m <mediaid> -d 0 -justmedia"

Can some one please help?

Thanks in advance
 
The way I do it, in Windows, is to fire up excel, and put in the "bpexpdate -m" part in one cell, leave a blank cell (which will hold the tape number), then put in "-d 0 -justmedia". Next, I'll copy these down the page so I have a bunch of them. Then, I either hand type all tape numbers (only if there's a few), or paste them from another excel spreadsheet. After that, I save it as a .bat file and go run it.

It really seems like it's more trouble than it is. I could probably do this on 50 tapes in less than 5 minutes. I guess I could write script to expire tapes in "tape.txt" file, but the hard part is getting the tape numbers you want to expire.
 
hhhhhmmmmm.....

I work primarily with unix.... [please see note below]

I would create a flat file with the list of tapes... then use it in a "for loop"

##----------- cut Here -----------##
for i in `cat tape_list`
do
echo "***************** $i *****************"
bpexpdate -m $i -d 0 -justmedia
done
##----------- cut Here -----------##

Note: If you have plenty of disk space on that winders system you can install "cygwin" and perform this within cygwin.....
 
Thanks Rusty I think I will give that a shot. Never really thought of using Excel in that way at all.
 
Hi there,

U should use a text file with the name of your tape one per line name, "TAPE_EXAMPLE.txt"

then, have a script named "TAPE_EX.cmd"
FOR /F %%i IN (TAPE_EXAMPLE.txt) DO bpexpdate -m %%i -d 0 -justmedia
(one line)

call your script...
Un can update ur text file, and never have to re-edit your script

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top