Backup Script error "line 31: syntax error: unexpected end of file"
GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Backup Script error "line 31: syntax error: unexpected end of file"
This script us to work then one of the Admin guys did something to it. Now it gives the following error when running.
./backup2tape: line 26: unexpected EOF while looking for matching `"'
./backup2tape: line 31: syntax error: unexpected end of file
-----------------------------------------------------------
This is the Script
###########################################################
#
# BACKUP TO TAPE FOR APPX
#
# Backup from /BACKUPS/Bkp2Disk_D onto tape
# Backup files are all the tar files in /BACKUPS/Bkp2Disk_D
# should be DayXZ.tar files & WeekYZ.tar files where:
# X = 1-4 and
# Y = 1-4 and
# Z = A, L and S
#
# bkpdir = ??
#---- assignment of vars (file names & dir names)
eko="echo -e"
errfound="N"
bkpdir="/BACKUPS/Bkp2Disk_D
#
cd $bkpdir
tar cvf /dev/st0 *
if [ "$?" = "0" ]
then
errfound="N"
else
errfound="Y"
date=`date`
$eko "$date *** TAR DAILY/WEEKLY BACKUP TO TAPE FAILED !!!!! ******** " >> /BA
CKUPS/logs/tape-backup-err
fi
#
mt -f /dev/st0 rewoff
Well, what did he change? Have you reverted back to the original? Try commenting out your little echo script on line 26 to see if that fixes the problem, seems that's what's causing the script to stop. And you should really paste your script inbetween the code tags, might be easier to read.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.