This is a small script i use to backup MySQl Database, I use it in my everyday system administration job so feel free to use and configure it. This will backup a database and zip the file.

#!/bin/sh

date=`date -I`
mysqldump -uroot -ptest123 database | gzip -a > /home/mysql-backup/database-$date.sql.gz

Here is another one if you want to backup all database and zip the file.

#!/bin/sh

date=`date -I`
mysqldump -uroot -ptest123 –all-databases | gzip -a > /home/mysql-backup/database-$date.sql.gz

Like this blog? Why not buy me a cup of coffee?

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Related Post

  • No Related Post