Hi, I put a for loop in a script to eject backup tapes from the robot. The command echo' output goes to the log file without problem, but command vmchange's output does not go to the log file although it's working fine. It still displays on the screen. I've tried '2>&1 1>$log', but nothing changed.
Why? It really bothers me. Please help. Thank you!
for tape in `/usr/openv/netbackup/bin/goodies/available_media | grep TLD | grep FULL | sort | awk '{print $1}'`
do
echo "Eject $tape" >> /tmp/tapeject.log
vmchange -res -multi_eject -w -verbose -rn 0 -rt tld -rh `hostname` -vh `hostname` -ml $tape -single_cycle >> /tmp/tapeject.log
done
# ./ejecttest
Slot# MediaID Barcode MAP_Element# Batch Status
6 000010 UNKNOWN 1 1 Ejected.
Moving media ID 000010 to standalone residence in the database.: Slot# MediaID Barcode MAP_Element# Batch Status
9 000012 UNKNOWN 2 1 Ejected.
Moving media ID 000012 to standalone residence in the database.: Slot# MediaID Barcode MAP_Element# Batch Status
10 000065 UNKNOWN 3 1 Ejected.
Moving media ID 000065 to standalone residence in the database.: Slot# MediaID Barcode MAP_Element# Batch Status
14 000066 UNKNOWN 4 1 Ejected.
Moving media ID 000066 to standalone residence in the database.: Slot# MediaID Barcode MAP_Element# Batch Status
16 000170 UNKNOWN 5 1 Ejected.
Moving media ID 000170 to standalone residence in the database.: Slot# MediaID Barcode MAP_Element# Batch Status
7 000177 UNKNOWN -1 -1 Eject aborted.
Slot# MediaID Barcode MAP_Element# Batch Status
4 000179 UNKNOWN -1 -1 Eject aborted.
Slot# MediaID Barcode MAP_Element# Batch Status
12 000518 UNKNOWN -1 -1 Eject aborted.