Skip to content

Commit

Permalink
mount backups to db
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Jun 28, 2024
1 parent 1e7f1ab commit 1465961
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dmoj/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ services:
volumes:
- /user/wlmoj/database/:/var/lib/mysql/
- ./scripts/mariadb:/docker-entrypoint-initdb.d/
- /etc/localtime:/etc/localtime:ro
- /user/wlmoj/backups:/backups
env_file: [ environment/mysql.env, environment/mysql-admin.env ]
networks: [ db ]
deploy:
Expand Down
6 changes: 6 additions & 0 deletions dmoj/scripts/backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
cd $(dirname $(dirname $0)) || exit
#export NAME=/home/dmoj/backups/$(date +"%Y-%m-%d_%H-%M-%S.%N").tar.gz

docker compose exec $COMPOSE_EXEC_FLAGS db mariadb-backup --backup --compress --target-dir="/backup" --user="$MYSQL_USER" --password="$MYSQL_PASSWORD" --host="db" --port="$MYSQL_PORT"
#mysqldump --all-databases -u "$MYSQL_USER" -pdmoj | gzip > $NAME && curl -X POST -F "file=@$NAME" http://10.10.10.1:8008/

0 comments on commit 1465961

Please sign in to comment.