Browse Source

adds mysql dump to backup.sh

test
Jean-Christophe Vanhalle 2 years ago
parent
commit
e807e5ee19
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      backup.sh

+ 6
- 1
backup.sh View File

mkdir -p "${backup_path}" mkdir -p "${backup_path}"


volumes="db traefik-dynamic traefik-certs traefik-logs traefik-static webroot" volumes="db traefik-dynamic traefik-certs traefik-logs traefik-static webroot"

for volume in ${volumes}; do for volume in ${volumes}; do
mkdir -p "${backup_path}/${volume}" mkdir -p "${backup_path}/${volume}"
docker run \ docker run \
ubuntu \ ubuntu \
tar -cvzf "/destination/${volume}.tar.gz" -C "/${volume}" . tar -cvzf "/destination/${volume}.tar.gz" -C "/${volume}" .
done done

docker exec "${PREFIX}-db" \
/usr/bin/mysqldump \
-u root \
--password="${DB_ROOT_PASSWORD}" \
"${DB_NAME}" > "${backup_path}/db/dump.sql"

Loading…
Cancel
Save