Skip to content

Commit

Permalink
Merge pull request #12 from Starfly-13/backup-infrastructure
Browse files Browse the repository at this point in the history
Adds script to generate backup SQL for database
  • Loading branch information
blinkdog authored Dec 17, 2023
2 parents 449698a + 9f78c5c commit 3734e0c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ss13-db-backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# ss13-db-backup
# use mysqldump to dump a SQL backup of the starfly13 database container

# 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 -

0 comments on commit 3734e0c

Please sign in to comment.