aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-27 17:16:30 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-27 17:16:30 -0300
commit6f1d9b5e34fb1be181874633cfcde77a5db0b8f9 (patch)
tree5b1e91dfe0c54bc0aaea1d0e5099753f97ac224f
parentb9efe747df5031ea5e3effe5c8d9562780cc1d9d (diff)
downloadhydra-6f1d9b5e34fb1be181874633cfcde77a5db0b8f9.tar.gz
hydra-6f1d9b5e34fb1be181874633cfcde77a5db0b8f9.tar.bz2
Allowing DATE for hydra_backup_environment
-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