This is the error I am getting now..below is the entire script. I am having to peicemeal the testing of it..till I can figure it all out. Thanks for anyhelp you can assist with.
tapemgr_Main_Menu()
{
while : do
echo "Legato Tape Management System Menu"
echo "This system is used to report Legato ERV Offsite and Tapes Returned"
echo "1. BUR IPS Tape Offsite Report"
echo "2. BUR IPS TAPE Returns from ERV"
echo "q. Quit or Ctrl-C"
echo "Select an option 1,2,q"
read option
case $option in
1) Tapes_Offsite_Menu();;
2) Tapes_Return_Menu();;
q) exit;;
esac
done
tapemgr.sh: syntax error at line 41: `done' unexpected
bash-2.05$
Entire script after your corrections...
# Tape Manager Menu for Legato IPS Reporting for Offsite and Return tapes
#
#!/bin/bash
#
# Defing all variables
set -x
rm -i $tapemgr/rpts/*.*
dat=`date +"%b%y"`
tapemgr="/export/home/legato/tapemgr"
ERVTAPE_RET=$tapemgr/rpts/ervtape_ret.$dat
ERVTAPE_ALOC=$tapemgr/rpts/tmp/ervtape__aloc
MOFFSITE=$tapemgr/rpts/offsite/Mthly_Offsite.rpt.$dat
WOFFSITE=$tapemgr/rpts/offsite/Wkly_Offsite.rpt.$dat
BOFFSITE=$tapemgr/rpts/offsite/Both_Offsite.rpt.$dat
EMAIL_NOTICE=$tapemgr/rpts/email.rpt$dat
FTP_HOST='xxx'
FTP_LOGIN='xxx'
FTP_PWD='xxx'
EJECT_TAPES=$tapemgr/rpts/tmp/eject_tapes.out
TMP=$tapemgr/rpts/tmp
# TAPE MANAGER MAIN MENU
clear
tapemgr_Main_Menu()
{
while : do
echo "Legato Tape Management System Menu"
echo "This system is used to report Legato ERV Offsite and Tapes Returned"
echo "1. BUR IPS Tape Offsite Report"
echo "2. BUR IPS TAPE Returns from ERV"
echo "q. Quit or Ctrl-C"
echo "Select an option 1,2,q"
read option
case $option in
1) Tapes_Offsite_Menu();;
2) Tapes_Return_Menu();;
q) exit;;
esac
done
}
Tapes_Offsite_Menu()
{
while:do
echo "Select an option for Offsite Report - '(W)'eekly '(M)'onthly '(B)'oth"
read option
case $option in
W)Weekly_Offsite();;
M)Monthly_Offsite();;
B)Both_Offsite();;
x)tapemgr_Main_Menu();;
esac
done
}
Tapes_Return_Menu()
{
while:do
echo "Tapes Return Menu"
echo "Enter IPS tape '(V)olumes or (D)ates to be returned'"
echo "R - Return to Main Menu"
case $SEL in
V) Volume_Returns();;
D) Volume_Date_Returns();;
r) tapemgr_Main_menu();;
esac
done
}
Volume_Returns()
{
echo "Enter Volumes to be returned", read $input
mminfo -q volume=$1 -q location=ERV | awk {'print $1'}
# if [location =! "ERV" ]; then
echo " volume does not exist at ERV"
# fi
}
Volume_Date_Returns()
{
echo "Return of all '"expired"' ERV tapes '(y/n)'"
# if $1 = "y", then
mminfo -q volrent=expired -q location=ERV -r volume,volretent,pool | more > $TMP/vol.out
echo " Is this list the correct list of tapes to be returned?"
# if $1 == "y", then next
echo "Enter date of tapes to be returned '(mm/dd/yy or enter today, yesterday, last week)'", read $1
# if $1 = ??
mminfo -q volretent=$1 -q location=ERV -r volume, volrent,pool |more $TMP/vol.out
# fi
}
## Run Weekly Offsite Report
Weekly_Offsite()
{
echo "$dat BURS Weekly Offsite STK9310 Tape Report " > $WOFFSITE
mminfo -r volume,volretent,pool,location -q pool="COE Full Offsite Weekly" -q location="STK9310" >> $WOFFSITE >$EJECT_TAPES
echo "Total WEEKLY OFFSITE IPS TAPES " | wc -l | $WOFFSITE > $OFFSITE_REPORT >$EMAIL_NOTICE
TMP_FILES()
FTP_FILES()
EMAIL_NOTIFICATION()
}
## Run Monthly Report
Monthly_OffSite()
{
echo "$dat BURS Weekly Offsite STK9310 Tape Report " > $MOFFSITE
mminfo -r volume,volretent,pool,location -q pool="COE Full Offsite Monthly" -q location="STK9310" >> $MOFFSITE >$EJECT_TAPES
echo "TOTAL Monthly Offsite IP Tapes" | wc -l $MOFFSITE > $OFFSITE_REPORT > $EMAIL_NOTICE
TMP_FILES()
FTP_FILES()
EMAIL_NOTIFICATION()
}
#### Both or Any Tapes that should be offsite Monthly or Weekly
Both_Offsite()
{
echo "$dat BURS Any Offsite STK9310 Tape Report " > $BOFFSITE
mminfo -r volume,volretent,pool,location -q pool="COE Full Offsite Monthly" -q location="STK9310" > $BOFFSITE >$EJECT_TAPES
mminfo -r volume,volretent,pool,location -q pool="COE Full Offsite Weekly" -q location="STK9310" >> $BOFFSITE >>$EJECT_TAPES
echo " Total IPS Tapes going Offsite" | wc -l $BOFFSITE >> $BOFFSITE >> EMAIL_NOTICE
TMP_FILES ()
FTP_FILES()
EMAIL_NOTIFICATION()
}
### Send Email Notification
EMAIL_NOTIFICATION()
{
echo "mail function"
#mailx -s "$dat BURS-Offsite IPS Tape Report" < $EMAIL_NOTICE
am001111@eds.com kathe.flanigan@eds.com
}
# Create TMP Files for cuting and pasting
TMP_FILES()
{
cut -c1-8 $EJECT_TAPES | sort +1 > $TMP/eject_sort.out
}
# FTP FILES TO HOST SERVER
FTP_FILES()
{
ftp -n $FTP_HOST <<END_SCRIPT
quote USER $FTP_LOGIN
quote PASS $FTP_PWD
END_SCRIPT
}
bash-2.05$