From b62ce3edaa1dffa015195998f0256ae583d08373 Mon Sep 17 00:00:00 2001 From: Patrick Meade Date: Tue, 12 Dec 2023 17:38:29 -0600 Subject: [PATCH 1/2] Add first draft at backup infrasturcture; mariadb --- ss13-db-backup | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 ss13-db-backup diff --git a/ss13-db-backup b/ss13-db-backup new file mode 100755 index 00000000000..a67d092341d --- /dev/null +++ b/ss13-db-backup @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# ss13-db-backup +# use mysqldump to dump a SQL backup of the starfly13 database container + +# ensure the backup directory exists +mkdir -p /tmp/backup + +# dump the database to a compressed SQL file in the backup directory +MYSQL_ROOT_PASSWORD=$(head -1 config/dbconfig.txt | awk -e '{print $3}') +docker exec --interactive --tty starfly_db \ + mysqldump --password=${MYSQL_ROOT_PASSWORD} starfly13 \ + | gzip > /tmp/backup/mariadb.sql.gz From 9f78c5c41bb48f2cd2c0e6a39c439eadd59c79bc Mon Sep 17 00:00:00 2001 From: Patrick Meade Date: Sat, 16 Dec 2023 22:13:11 -0600 Subject: [PATCH 2/2] Modify the database backup script to send to stdout --- ss13-db-backup | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ss13-db-backup b/ss13-db-backup index a67d092341d..883d4f80ed8 100755 --- a/ss13-db-backup +++ b/ss13-db-backup @@ -2,11 +2,8 @@ # ss13-db-backup # use mysqldump to dump a SQL backup of the starfly13 database container -# ensure the backup directory exists -mkdir -p /tmp/backup - -# dump the database to a compressed SQL file in the backup directory +# dump the database to a compressed SQL file on standard out MYSQL_ROOT_PASSWORD=$(head -1 config/dbconfig.txt | awk -e '{print $3}') docker exec --interactive --tty starfly_db \ mysqldump --password=${MYSQL_ROOT_PASSWORD} starfly13 \ - | gzip > /tmp/backup/mariadb.sql.gz + | gzip -