aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/backup-restore-mail1
-rwxr-xr-xshare/hydractl/backup-restore-site11
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