17 lines
601 B
Plaintext
17 lines
601 B
Plaintext
|
#!/bin/bash
|
||
|
# TARGET: Backup-Ziel
|
||
|
# IGNORE: Liste zu ignorierender Datenbanken (durch | getrennt)
|
||
|
IGNORE="mysql|information_schema|performance_schema|test"
|
||
|
PASSWORD="DtkXaU6ZeWeizvcZjRQJqY3no9dGf3ASa7N73Y8Z8PULxJVrvvrq7AAak4s2HvD2"
|
||
|
|
||
|
DBS="$(/usr/bin/mysql --host="mysql" --user="root" --password="$PASSWORD" -Bse 'show databases' | /usr/bin/grep -Ev $IGNORE)"
|
||
|
|
||
|
rm -f *.sql.bz2
|
||
|
|
||
|
for DB in $DBS; do
|
||
|
/usr/bin/mysqldump --host="mysql" --user="root" --password="$PASSWORD" --skip-extended-insert --skip-comments "$DB" | bzip2 -c > "$DB.sql.bz2"
|
||
|
done
|
||
|
|
||
|
echo "$0 - Backup erfolgreich durchgefuehrt"
|
||
|
exit 0
|