Rsync+cront Building a data mirroring backup system
for a more clear introduction rsync the use of server mode, here through an enterprise case, describes how to build a remote disaster recovery backup system.
Case description
an e-commerce enterprise has a portal site, The Web server operating system is Linux, website data will be increased every day. To ensure data security, a remote disaster recovery system is needed to back up the site data to a remote disaster-tolerant server at 3 o ' Day early morning . Because the amount of data is not very large, only incremental backups per day, that is, only to back up the day of increased data, when the site fails, you can restore the data to the maximum extent.
Solution Solutions
It is assumed that thereA,Btwo xLinuxSystem,Asystem as a Web server,BSystem asARemote disaster Recovery backup machine, soAsystem isrsyncthe server side,Bsystem isRYSNCof the client. In order to complete the disaster-recovery backup of the data,A,BBoth are installed on both systemsrsyncsoftware, so that, inArunning on the systemrsyncDaemon, while theBSystems can be passed through the system daemoncrontabto schedule backups byAsystem-specific data to enable remote disaster recovery of the data.
System environment
Operating System: Red Hat Enterprise Linux Server release 6
kernel version: 2.6.18-8e15
Web_server system IP Address: 192.168.1.170
Backup system IP Address: 192.168.1.171
-
< Strong> web_server Configuration on the server rsync
rsync /etc/rsyncd.conf after installation rsync rsyncd.conf file consists of one or more modules, corresponding to the global parameters and module parameters, a module defined from square brackets " []
in the Start the rsync daemon on the web_server server
in the Configuring rsync on the BACKUP system
no settings on the backup server, just be aware of You can do it on a year. In order to not enter the password during the year, you need to backup A secerts file web_server server rsyncd.conf " auth users rsync specify when synchronizing.
Set up a scheduled backup policy
There are many ways to trigger a synchronization instruction, for example, you can put the synchronization instructions in the client system's crontab Daemon, set the sync time, and then let Linux the system triggers the synchronization instruction and completes the data backup automatically. This method of data backup can be used in business systems where data security requirements are not high.
For example: set every morning 3 Point - perform a mirrored backup of
This article is from the "A-B" blog, please be sure to keep this source http://51inte.blog.51cto.com/4403468/1708056
Rsync+cron Building Data Mirroring backup system