FAQ
•
Search
•
User Groups
•
Forum Admins
•
Smilies List
•
Statistics
•
Rules
•
Login
•
Register
H
ome
FAQs
L
inks
N
ews
Online Tools
phpBB
Scripts
T
utorials
A
bout us
C
ontact us
Contribute
Credits
Link to us
error in restore code
Forum Index
»
Client-Side Coding
Author
Message
jasminemark
Junior WebHelper
Joined: 01 Apr 2011
Posts: 4
Posted: Fri Apr 01, 2011 7:11 am (13 years ago)
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
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
Forum Index
»
Client-Side Coding
Jump to:
Select a Forum
» 4WebHelp
Announcements
Our Site: Feedback & Questions
» General
Chit Chat
Freedom2Surf
Advertisements
» Support
General
Website Reviews
Client-Side Coding
Server-Side Coding
Databases
Web Servers
Hosting & Domain Names
Graphics & Flash
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.322271 seconds :: 18 queries executed :: All Times are GMT
Powered by
phpBB
2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme