From a7bb43458ea3a6b7cc367a35013af8c313f4fef4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 28 Jun 2012 11:53:41 -0300 Subject: Unifying database restoration with hydra_backup_restore_database --- share/hydractl/backup-restore-site | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'share/hydractl/backup-restore-site') diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site index 3c22e52..f9d7acc 100755 --- a/share/hydractl/backup-restore-site +++ b/share/hydractl/backup-restore-site @@ -146,30 +146,8 @@ if [ -e "$FOLDER/drupal" ]; then fi fi -# Check if there are database dumps -if [ -f "$DB_DUMP_BASE/$SITE.sql.gz" ]; then - DB_DUMP_EXT=".gz" - DB_DUMP_EXTRACT="gunzip" -elif [ -f "$DB_DUMP_BASE/$SITE.sql.bz2" ]; then - DB_DUMP_EXT=".bz2" - DB_DUMP_EXTRACT="bunzip2" -elif [ -f "$DB_DUMP_BASE/$SITE.sql" ]; then - DB_DUMP_EXT="" - DB_DUMP_EXTRACT="true" -fi - # Restore database -if [ ! -z "$DB_DUMP_EXT" ]; then - echo "Restoring database $SITE..." - hydra_set_tmpfile $SITE -d - cp $DB_DUMP_BASE/$SITE.sql$DB_DUMP_EXT $TMPWORK - ( cd $TMPWORK && $DB_DUMP_EXTRACT $SITE.sql$DB_DUMP_EXT ) - hydra_truncate_database $SITE - mysql $SITE < $TMPWORK/$SITE.sql - hydra_unset_tmpfile $TMPWORK -else - echo "Database should be manually restored" -fi +hydra_backup_restore_database $SITE # Ikiwiki if [ -e "$FOLDER/ikiwiki" ]; then -- cgit v1.2.3