smeserver-affa/root/etc/affa/scripts/mysql-dump-tables

11 lines
264 B
Plaintext
Raw Normal View History

#!/bin/sh
mkdir -p /tmp/MySQL-Dumps
chmod 700 /tmp/MySQL-Dumps
for db in $(mysql -BNre "show databases;")
do
mysqldump --add-drop-table --single-transaction -QB "$db" -r /tmp/MySQL-Dumps/"$db".dump || exit 1
chmod 400 /tmp/MySQL-Dumps/"$db".dump
done
exit 0