aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-01-19 10:24:53 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-01-19 10:24:53 -0200
commit9aea1c1fee5dfc7367767a369a4c9a83fbb3db3c (patch)
tree3ede12f2b5fc599fc42d221af25e1bd52f456b21 /share
parent3262d2402ace2596da2efb35cf5150280d9657d1 (diff)
downloadhydra-9aea1c1fee5dfc7367767a369a4c9a83fbb3db3c.tar.gz
hydra-9aea1c1fee5dfc7367767a369a4c9a83fbb3db3c.tar.bz2
Decompress backups before checking it their folder exist
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/backup-restore-site14
1 files changed, 7 insertions, 7 deletions
diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site
index 2871b13..0db4667 100755
--- a/share/hydractl/backup-restore-site
+++ b/share/hydractl/backup-restore-site
@@ -55,6 +55,13 @@ else
SITE_GROUP="root"
fi
+# Local backups are stored compressed
+if [ "$1" == "localhost" ] || [ "$1" == "backups" ]; then
+ if [ -e "$RESTOREDIR/$SITE.tar.bz2" ]; then
+ ( cd $RESTOREDIR && tar xvf $SITE.tar.bz2 )
+ fi
+fi
+
# Check if folder exist on the backup.
if [ ! -d "$RESTOREDIR/$FOLDER" ]; then
echo "Folder $FOLDER does not exist at restored backup $RESTOREDIR"
@@ -74,13 +81,6 @@ if [ -e "$FOLDER" ]; then
fi
fi
-# Local backups are stored compressed
-if [ "$1" == "localhost" ]; then
- if [ -e "$RESTOREDIR/$SITE.tar.bz2" ]; then
- ( cd $RESTOREDIR && tar xvf $SITE.tar.bz2 )
- fi
-fi
-
# Copy site folder from backup
if [ -d "$RESTOREDIR/$FOLDER" ]; then
echo "Copying site $SITE from backup $RESTOREDIR..."