summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-27 18:25:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-27 18:25:29 -0300
commit31dc68a7964068df0f99a4d9d6fc7753c3f3597c (patch)
tree46285d2fb7348ca67f11923ece3073f139a8d86a /share
parentdb701044d292d3bce1ca3d6f1df8547fccd978a3 (diff)
downloadhydra-31dc68a7964068df0f99a4d9d6fc7753c3f3597c.tar.gz
hydra-31dc68a7964068df0f99a4d9d6fc7753c3f3597c.tar.bz2
Database restoring at backup-restore-site
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/backup-restore-site5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site
index d02fb79..15c0d97 100755
--- a/share/hydractl/backup-restore-site
+++ b/share/hydractl/backup-restore-site
@@ -73,7 +73,12 @@ fi
# Restore database
if [ -f "$RESTOREDIR/var/backups/mysql/sqldump/$SITE.sql.gz" ]; then
+ hydra_set_tmpfile $SITE -d
+ cp $RESTOREDIR/var/backups/mysql/sqldump/$SITE.sql.gz $TMPWORK
+ ( cd $TMPWORK && gunzip $SITE.sql.gz )
hydra_truncate_database $SITE
+ mysql $SITE < $TMPWORK.sql
+ hydra_unset_tmpfile $TMPWORK
else
echo "Databases should be manually restored"
fi