aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/backup7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/hydra/backup b/lib/hydra/backup
index 252d41a..210139b 100644
--- a/lib/hydra/backup
+++ b/lib/hydra/backup
@@ -7,7 +7,12 @@ function hydra_backup_environment {
BACKUP_ROOT="/var/backups/remote"
DOMAIN="`facter domain`"
BACKUPDIR="$BACKUP_ROOT/$NODE.$domain"
- RESTOREDIR="$BACKUPDIR/restore/`date +%Y%m%d`"
+
+ if [ ! -z "$DATE" ]; then
+ RESTOREDIR="$BACKUPDIR/restore/$DATE"
+ else
+ RESTOREDIR="$BACKUPDIR/restore/`date +%Y%m%d`"
+ fi
if [ -z "$NODE" ]; then
hydra_action_usage