Skip to main content

Mysql Hotcopy Backup Script

It is very easy to get mysql hot copy backup with the following script. /mysql_backup is nfs mounted disk.


#!/bin/bash
umount /mysql_backup
mount /mysql_backup
backup_day=$(date +%A)
mysqlhotcopy -u <dbuser> –password=<dbpass>  <dbname> /mysql_backup/
tar zcfp /mysql_backup/<dbname>_$backup_day.TGZ /mysql_backup/<dbname>
rm -fr /mysql_backup/<dbname>
umount /mysql_backup

Comments

Popular posts from this blog