diff options
author | Simon Rettberg | 2015-09-05 20:48:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-05 20:48:22 +0200 |
commit | 8edc84bb2fd77c40b4e47fc64d1c6045b6b4aa5f (patch) | |
tree | 0763b3f42876f207cea5aeb741cb063578f7d5f7 /scripts/system-backup | |
parent | [tmlite-bwlp] mount-store script: corr. var $RANDOM (diff) | |
download | tmlite-bwlp-8edc84bb2fd77c40b4e47fc64d1c6045b6b4aa5f.tar.gz tmlite-bwlp-8edc84bb2fd77c40b4e47fc64d1c6045b6b4aa5f.tar.xz tmlite-bwlp-8edc84bb2fd77c40b4e47fc64d1c6045b6b4aa5f.zip |
Refine mount script, updater backup/restore to handle new dozmod db
Diffstat (limited to 'scripts/system-backup')
-rwxr-xr-x | scripts/system-backup | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/system-backup b/scripts/system-backup index d4b9ebe..780463e 100755 --- a/scripts/system-backup +++ b/scripts/system-backup @@ -15,16 +15,17 @@ fi mkdir -p "$DIR" cd "$DIR" || exit 1 -mysqldump --defaults-extra-file=/etc/mysql/debian.cnf --add-locks --add-drop-database --default-character-set=utf8 --databases openslx bwLehrpool > db.sql -RET=$? -if [ $RET -ne 0 ]; then - echo "Database dump failed with exit code $RET" +mysqldump --defaults-extra-file=/etc/mysql/debian.cnf --add-locks --add-drop-database --default-character-set=utf8 --databases openslx > openslx.sql +RET1=$? +mysqldump --defaults-extra-file=/etc/mysql/debian.cnf --add-locks --add-drop-database --default-character-set=utf8 --databases sat > sat.sql +RET2=$? +if [ $RET1 -ne 0 ] || [ $RET2 -ne 0 ]; then + echo "Database dump failed with exit code $RET1/$RET2" exit 1 fi FILELIST=" /opt/openslx/configs - /opt/syncdaemon/config/identity.properties /etc/lighttpd/server.pem /etc/lighttpd/chain.pem /srv/openslx/www/boot/default/config.tgz @@ -36,7 +37,7 @@ if [ $RET -ne 0 ]; then echo "WARNING: filesystem-tar exited with code $RET - backup might be incomplete!" fi -tar -k -c -z -f backup.tgz files.tgz db.sql +tar -k -c -z -f backup.tgz files.tgz openslx.sql sat.sql RET=$? if [ ! -f backup.tgz ]; then echo "Creating backup.tgz failed!" |