As long as you start a business, even small-scale personal websites are micro-entrepreneurs, you should also pay attention to data backup, so that you do not have to go back to the past overnight ......
Common Causes of data problems: misoperations result in defects (unrecoverable), server temporary failures (waiting for the server to restore to normal), server fault import defects (unrecoverable), and intrusion.
Recent cloud host faults such as, more faults, please refer to: http://www.enet.com.cn/article/2012/0730/A20120730142946.shtml
Case study of data loss on personal websites:
Data to be backed up: the most important thing isCode, Databases, uploaded files (User portraits, product images, etc.), followed by software configuration (MySQL, Apache, etc ).
The Code backup method is simple:
Use the code library (SVN, git). Before each release, pass the local test, Tag, submit to the code library, and then go online.
If the code is lost due to a server failure, retrieve the latest tag from the code library.
Backup Method for a single database:
Generally, the developer is an intranet IP address, and the server cannot directly send it. Therefore, the crontab regular backup on the server is compressed to the local machine, and the Development machine crontab regularly downloads the backup (timed start, no need to keep the boot ).
Crontab mysqldump is relatively simple, not detailed, please refer to: http://www.cnblogs.com/bruceleeliya/archive/2012/05/04/2482733.html
Uploaded files:
One time: crontab is used to regularly package directories and download files.
When multiple servers are used: multiple Web servers are synchronized and redundant, and no separate backup is required.