aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl/backup-restore
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-01-04 15:43:08 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-01-04 15:43:08 -0200
commit26cbb26cebd495fd6260b6af65b37fe5c8a8c00b (patch)
tree02f5dae382c02f04e87d37816e409252f26579a7 /share/hydractl/backup-restore
parentf360acf0fab1d941bc7de8bec3d22aabd64f49fe (diff)
downloadhydra-26cbb26cebd495fd6260b6af65b37fe5c8a8c00b.tar.gz
hydra-26cbb26cebd495fd6260b6af65b37fe5c8a8c00b.tar.bz2
Support for restoring backups from /var/backups/restore; svn and git restore support
Diffstat (limited to 'share/hydractl/backup-restore')
-rwxr-xr-xshare/hydractl/backup-restore10
1 files changed, 7 insertions, 3 deletions
diff --git a/share/hydractl/backup-restore b/share/hydractl/backup-restore
index 160ed5e..a5bfd42 100755
--- a/share/hydractl/backup-restore
+++ b/share/hydractl/backup-restore
@@ -2,12 +2,16 @@
#
# Backup restoration.
#
-# TODO: optionally restore from local backup
-#
# Load.
source $APP_BASE/lib/hydra/functions || exit 1
hydra_config_load
-hydra_backup_environment_remote $*
+# Check restore strategy.
+if [ "$1" == "localhost" ]; then
+ hydra_backup_environment_local $2 restore
+else
+ hydra_backup_environment_remote $1 restore
+fi
+
duplicity restore file:///$BACKUPDIR/ $RESTOREDIR/