使用脚本AutoMySQLBackup.sh
下载地址:http://sourceforge.net/projects/automysqlbackup/
修改
# Username to access the MySQL server e.g. dbuser
USERNAME=root
# Username to access the MySQL server e.g. password
PASSWORD=dai
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost
# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
DBNAMES="jbpm"
# Backup directory location e.g /backups
BACKUPDIR="/db_backup"
将 AutoMySQLBackup.sh放置在/etc/cron.daily下
至此,我们在本机上实现了备份,有的时候,我们还是需要将备份好的数据文件传递到其他电脑上,这样才安全。