参考:http://codex.wordpress.org/WordPress_Backups
备份的方式
我自己的方式是
- 将程序文件放到bitbucket.org的私有库中存放
- 数据库使用cron的方式,参考:http://www.tamba2.org.uk/wordpress/cron/
#!/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,恢复成功。
Leave a Reply