From 32e2daf666edc2822d0505f8c1fe9831240ebfe1 Mon Sep 17 00:00:00 2001 From: Robert Wartenberg Date: Wed, 4 Oct 2023 09:21:03 +0200 Subject: [PATCH] add: backup script for boogie --- backup-boogie/backup-boogie.sh | 41 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/backup-boogie/backup-boogie.sh b/backup-boogie/backup-boogie.sh index 70e759c..3de078e 100644 --- a/backup-boogie/backup-boogie.sh +++ b/backup-boogie/backup-boogie.sh @@ -1,37 +1,34 @@ #!/bin/sh -# this one makes a copy of the whole /var/www/html from boogiedev - -todo! +# this one makes a copy of the whole /var/www/html from boogie to BFDS SCRIPTPATH=$(dirname `realpath $0`) cd $SCRIPTPATH # rsync source -> destination SOURCE_PATH=/var/www/virtual/boogie/html -DEST_PATH_FILES=/mnt/bfds/rob/backup/server/boggiedev.net/var_www - -# # ssh credentials -PORT="22" -KEY="${SCRIPTPATH}/boogie_keyless" -USER_AT_HOST="boogie@spaceboyz.net" +DEST_PATH_FILES=/mnt/bfds/rob/backup/server/boogiedev.net/var_www # path of the database backups -DEST_PATH_DB=/mnt/bfds/rob/backup/server/spaceboyz.net/mariadb +DEST_PATH_DB=/mnt/bfds/rob/backup/server/boogiedev.net/db # EXCLUDE="--exclude-from exclude-list" # ### Get all databases -# cd $DEST_PATH_DB -# # kick off DB dumping -# curl --insecure --silent https://rob.spaceboyz.net/backup_all_databases_cMxNrCTVLBPrNo6qaonojeejCvCepekwssh/dump_all_databases.php -# # download DB dumps -# curl --insecure --silent https://rob.spaceboyz.net/backup_all_databases_cMxNrCTVLBPrNo6qaonojeejCvCepekwssh/dumps.zip > dumps.zip -# if [ -f dumps.zip ] -# then -# today=`date +%F` -# mv dumps.zip all_databases_dump_$today.zip -# else -# echo "Datenbank Dump konnte nicht herunter geladen werden" -# fi +# kick off DB dumping +curl --insecure --silent https://backup.boogiedev.net/dump_all_databases.php + +# download DB dumps +cd $DEST_PATH_DB +curl --insecure --silent https://backup.boogiedev.net/dumps.zip > dumps.zip +if [ -f dumps.zip ] +then + today=`date +%F` + mv dumps.zip all_databases_dump_$today.zip +else + echo "Datenbank Dump konnte nicht herunter geladen werden" +fi + +## aufräumen +curl --insecure --silent https://backup.boogiedev.net/dump_all_databases.php?cleanup_dump=1 \ No newline at end of file