aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl/backup-restore
blob: 438d1a648a5d567d5e8c87f6b703c619bfc28989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#
# Backup restoration.
#

# Load.
source $APP_BASE/lib/hydra/functions || exit 1
hydra_config_load

# Syntax check.
if [ -z "$1" ]; then
  echo "Usage: `basename $0` <localhost|server> [rsync|rdiff]"
  exit 1
fi

# Check restore strategy.
if [ "$1" == "localhost" ]; then
  hydra_backup_environment_local
else
  hydra_backup_environment_remote $*
fi

duplicity restore file:///$BACKUPDIR/ $RESTOREDIR/