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

Backup script help.

Status
Not open for further replies.

druid1

IS-IT--Management
Jul 15, 2002
14
GB
I have just installed redhat 7.3 which is using shell sh-2.05a and am trying to run my backup scripts that I used on redhat 7. I have changed the script for the question. The script looks like this :-
#!/bin/sh
DAY=`date | /bin/cut -b1-3`
#
if [ $DAY = Wed ]
then
BACKUP_TYPE=FULL
else
BACKUP_TYPE=DAILY
fi

case $BACKUP_TYPE in
FULL)
echo "FULL BACKUP RUNNING"
;;
DAILY)
echo "DAILY BACKUP RUNNING"
;;
esac

Here is the error :-

'/backup.sh: line 25: syntax error near unexpected token `in
'/backup.sh: line 25: `case $BACKUP_TYPE in

I also have this script running on a Sun machine.

TIA
 
Have you tried deleting and retyping the first line of the case statement? Might just be a non-printing character or something. Post back if that doesn't work. Cheers.
 
I have re-type in the case statement but this still did not work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top