4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 error in restore code
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
jasminemark
Junior WebHelper
Junior WebHelper


Joined: 01 Apr 2011
Posts: 4

PostPosted: Fri Apr 01, 2011 7:11 am (13 years ago) Reply with QuoteBack to Top

Could someone tell me what I am doing wrong by entering the following code take from the restore script in LXF#126?

#!/bin/sh

if [ -f $1/../backup.tar.gz ]
then
tar -xz --file=$1/../backup.tar.gz
rsync --recursive --times --perms $1 $2
rm -rf $1
echo "Restore successful"
elif [ -d $1 ]
rsync --recursive --
times --perms $1 $2
tar -cz --file=$2/../backup.tar.gz $1 $2
rm -rf $1
echo "Restore successful"
then
else
echo "Restore failed"
fi

Every time I run it I get the following error
restore.sh: line 15: syntax error near unexpected token `else'
restore.sh: line 15: `else'

________________________________
Funny Cricket Image
OfflineView User's ProfileFind all posts by jasminemarkSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.284223 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme