]> gitweb.fluxo.info Git - hydra.git/commitdiff
Restoration fixes
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 May 2014 16:55:55 +0000 (13:55 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 May 2014 16:55:55 +0000 (13:55 -0300)
share/hydractl/backup-restore-mail
share/hydractl/backup-restore-site

index 30cc42faf5376bdb5ce3da191730b7fb786a00f5..371cd3aa25c251a490f59e35d60c156fef6319c7 100755 (executable)
@@ -46,6 +46,7 @@ for folder in `ls $RESTOREDIR/$SERVICE_DIR`; do
 done
 
 # Restore database.
+mkdir -p $DATABASE_DIR
 rsync -av $RESTOREDIR/$DATABASE_DIR/ $DATABASE_DIR/
 
 # Fix permissions.
index 9a25738d6bc87a3ef03a6ee0e83491e480f75cdb..bf4899430811ba627f3ba5b226619e67db81b462 100755 (executable)
@@ -21,7 +21,7 @@ source $APP_BASE/lib/hydra/functions || exit 1
 hydra_config_load
 
 # Basic parameters.
-SITE="$3"
+SITE="$2"
 SITES="/var/sites"
 FOLDER="$SITES/$SITE"
 WWW="/var/www/data"
@@ -34,7 +34,14 @@ fi
 
 # Check restore strategy.
 if [ "$1" == "backups" ]; then
-  hydra_backup_environment_local_website $2 $3
+  SITE="$3"
+
+  if [ -z "$SITE" ]; then
+    hydra_action_usage
+    exit 1
+  fi
+
+  hydra_backup_environment_local_website $2 $SITE
 elif [ "$1" == "localhost" ] || [ "$1" == "`facter hostname`" ]; then
   hydra_backup_environment_local
 else