]> gitweb.fluxo.info Git - hydra.git/commitdiff
Allowing DATE for hydra_backup_environment
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 20:16:30 +0000 (17:16 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 20:16:30 +0000 (17:16 -0300)
lib/hydra/backup

index 252d41a2b1b11aae415bfea04a1f5d9727a36b04..210139b09be141c618aecf619f8e27a073950853 100644 (file)
@@ -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