All Linux HowTo's Scripting HowTo's Security HowTo's

Dump and Backup all MySQL Databases into their own files

This article demonstrates how to backup all MySQL databases into their own files and then tar the lot including system files. #!/bin/bash TO=”/root” FROM=”/etc /var/www/html /var/backups” DBUSER=”root” DBPASS=’MyPassword’ THISHOST=`hostname` DBLIST=`echo “show databases;” | mysql –password=$DBPASS -u $DBUSER | egrep -v ‘^Database$|^information_schema$|^mysql$’` for DBLOOP in `echo $DBLIST` do mysqldump -u $DBUSER

Read more