Shell Script To Dump All MySQL Databases Every Hour To NAS Storage

Posted on in Categories Backup, MySQL last updated July 15, 2009

+ Download this script

+ Modify settings according to your setup

+ Install cron job as follows to run script every hour

Sample Shell Script To Dump All MySQL Databases

6 comment

  1. Took the idea from the same script and made this one:

    save all mysql databases into a compressed file like /root/mysqlbackup.23.12.11.tar.gz

  2. Better remove this line FILE=”fs-full-$NOW.tar.gz” because you already used FILE=$BAK/mysql-$db.$NOW-$(date +”%T”).gz

  3. This script is very much useful.

    After taking backup I want to dump the same in another Database [In some aother machine] How to do that?

    The database name and everything should remain same in the another DB also.

    My intention is to create Mirror Database.

Leave a Comment