Think before you speak, read before you think.

wordpress备份策略

by

in

参考:http://codex.wordpress.org/WordPress_Backups

备份的方式

我自己的方式是

#!/bin/bash
DBNAME=wordpress
DBPASS=root
DBUSER=root
#Keep the " around your address
EMAIL="[email protected]"
#Change the 'wp_' to match your table_prefix in the database
mysqldump --opt -u $DBUSER -p$DBPASS $DBNAME > backup.sql
gzip backup.sql
DATE=`date +%Y%m%d` ; mv backup.sql.gz $DBNAME-backup-$DATE.sql.gz
echo 'Blog Name: Your mySQL Backup is attached' | /usr/bin/mutt $EMAIL -a $DBNAME-backup-$DATE.sql.gz -s "MySQL Backup"
rm $DBNAME-backup-$DATE.sql.gz

记录:通过上述方法在2012年10月31日yardvps挂掉换linode,恢复成功。


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *