diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-01-04 15:43:08 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-01-04 15:43:08 -0200 |
commit | 26cbb26cebd495fd6260b6af65b37fe5c8a8c00b (patch) | |
tree | 02f5dae382c02f04e87d37816e409252f26579a7 /lib | |
parent | f360acf0fab1d941bc7de8bec3d22aabd64f49fe (diff) | |
download | hydra-26cbb26cebd495fd6260b6af65b37fe5c8a8c00b.tar.gz hydra-26cbb26cebd495fd6260b6af65b37fe5c8a8c00b.tar.bz2 |
Support for restoring backups from /var/backups/restore; svn and git restore support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/backup | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/hydra/backup b/lib/hydra/backup index f98aa0f..9c35ff9 100644 --- a/lib/hydra/backup +++ b/lib/hydra/backup @@ -1,7 +1,7 @@ #!/bin/bash -# Setup environment for backup restored from localhost -function hydra_backup_environment_local { +# Setup environment for the backups website +function hydra_backup_environment_local_website { SITE="$1" BACKUPDIR="/var/sites/backups/site/$SITE" @@ -14,12 +14,26 @@ function hydra_backup_environment_local { RESTOREDIR="$BACKUPDIR/$DATE" else RESTOREDIR="$BACKUPDIR/`date +%Y%m%d`" - fi + fi DB_DUMP_BASE="$RESTOREDIR" mkdir -p $RESTOREDIR } +# Setup environment for backup restored from localhost +function hydra_backup_environment_local { + BACKUPDIR="/var/backups/duplicity" + + if [ ! -z "$DATE" ]; then + RESTOREDIR="/var/backups/restore/$DATE" + else + RESTOREDIR="/var/backups/restore/`date +%Y%m%d`" + fi + + DB_DUMP_BASE="$RESTOREDIR/var/backups/mysql/sqldump/" + mkdir -p $RESTOREDIR +} + # Setup environment for backup restored from remote source function hydra_backup_environment_remote { NODE="$1" |