From 9aea1c1fee5dfc7367767a369a4c9a83fbb3db3c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 19 Jan 2012 10:24:53 -0200 Subject: Decompress backups before checking it their folder exist --- share/hydractl/backup-restore-site | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'share/hydractl') 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..." -- cgit v1.2.3