Add a new backup script

This commit adds a backup script to backup all instances regularly.
Fixes #11.
This commit is contained in:
Tom Wiesing 2020-07-10 11:50:33 +02:00
parent 65a42f61e9
commit 21bd4f22c3
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
7 changed files with 115 additions and 17 deletions

View file

@ -41,7 +41,7 @@ function dockerized_mysql() {
return $retval
}
# 'dockerized_mysql' runs an sql command in the sql docker container interactively
# 'dockerized_mysql_interactive' runs an sql command in the sql docker container interactively
function dockerized_mysql_interactive() {
pushd "$DEPLOY_SQL_DIR" > /dev/null
docker exec -ti `docker-compose ps -q sql` mysql "$@"
@ -50,6 +50,15 @@ function dockerized_mysql_interactive() {
return $retval
}
# 'dockerized_mysqldump' runs a mysqldump command
function dockerized_mysqldump() {
pushd "$DEPLOY_SQL_DIR" > /dev/null
docker exec -i `docker-compose ps -q sql` mysqldump "$@"
retval=$?
popd > /dev/null
return $retval
}
###
### Bookkeeping sql
###