#!/usr/bin/env sh set -e . /app/setup.sh mkdir -p /backup/sqlDump for db in $(echo "$MYSQL_DUMP_DB" | sed 's/,/\n/g') do echo "Dumping db: $db" mysqldump --compact -P 3306 --host "$MYSQL_HOST" -u "$MYSQL_USERNAME" "-p$MYSQL_PASSWORD_ACTUAL" "$db" > "/backup/sqlDump/$db-mysql.sql" done for db in $(echo "$POSTGRES_DUMP_DB" | sed 's/,/\n/g') do echo "Dumping db: $db" pg_dump -U "$POSTGRES_USERNAME" --host "$POSTGRES_HOST" "$db" > "/backup/sqlDump/$db-postgres.sql" done restic --verbose backup "/backup"