diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-05-02 13:55:55 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-05-02 13:55:55 -0300 |
commit | 09081682e45402b776aa9188cb2829d03ecdd157 (patch) | |
tree | ba50fd821e95cba1d4eaf64adaba289c9c27e90b | |
parent | 176efc9b17199d19aad129a651c1ef0cd3afa3c0 (diff) | |
download | hydra-09081682e45402b776aa9188cb2829d03ecdd157.tar.gz hydra-09081682e45402b776aa9188cb2829d03ecdd157.tar.bz2 |
Restoration fixes
-rwxr-xr-x | share/hydractl/backup-restore-mail | 1 | ||||
-rwxr-xr-x | share/hydractl/backup-restore-site | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/share/hydractl/backup-restore-mail b/share/hydractl/backup-restore-mail index 30cc42f..371cd3a 100755 --- a/share/hydractl/backup-restore-mail +++ b/share/hydractl/backup-restore-mail @@ -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. diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site index 9a25738..bf48994 100755 --- a/share/hydractl/backup-restore-site +++ b/share/hydractl/backup-restore-site @@ -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 |