Rsync + inotify for real-time server backup
Inotify:
Inotify is integrated into the kernel. inotify is used as a third-party software to monitor directory changes through the interfaces provided by the kernel.
The inotifywait command can monitor fine-grained real-time changes to files in the directory. The monitored command is
Inotifywait-mrq -- timefmt '% d/% m/% y % H: % m' -- format' % T % w % f % e'
After the rsync server configuration is over, the next step is to issue an rsync command on the client to enable the server-side files to be backed up to the client. Rsync is a very powerful tool, and its commands have many feature options, and we'll analyze all of its optio
1. Enable rsync from the Database Server
Vi/etc/rsyncd. conf
Edit rsync Configuration
/Usr/bin/rsync -- daemon
Start rsync
2. Stop the crontab of the log Collection Server
/Etc/init. d/cron stop
3. Stop the primary database
1. install the inofity-tools tool and rsync on the server (note that the server is the backup system), and install rsync on the client (that is, the backup system stores the backup files of the server)
2. Configure the/etc/rsyncd. conf file on the client. The content is as
The data in the server is the most important, the data of commercial use is more important, once lost, the result is unimaginable. So backup is important. Can be used to Rsync+crontab to do data synchronization.Method/Step
The first is the installationwget http://rsync.samba.org/ftp/rsync/src/rsync-3.1.0.tar.gzCD
Rsync is the next best software for synchronizing files on Linux, and it can be used under Windows, but the name is Cwrsync. This article mainly introduces the use of Windows as the server of Rsync, Linux for the use of the client. Cwrsync is also divided into a client-side service, Service side: Cwrsync_server_2.0.10_installer Client: Cwrsync_2.0.10_installer W
First, the basic knowledgeRsync is divided into server-side, client-side, server-building than the client hard (and very simple).The rsync server is the server that runs the rsync service in Deamon mode and needs to open the
with counter switch.Does the backup server need to access \\dbserver\LogBackup? Then we share one such path on the same network as the backup server (intermediate server), and for the backup server, you can access the \\dbserver\LogBackup as long as it is available, regardless of who is sharing it.The problem with the
Server:
Ensure Rsync is installed.
Configure/etc/rsyncd. conf. Generally, Rsync is installed and does not automatically create rsyncd. conf. The configuration is as follows:
# Rsync configuration fileSecrets file =/etc/rsyncd. Secrets # name and location of the authenticated user name and password fileMotd file =/
Description
1. Cwrsyncserver Service End
System: Windows Server 2003
IP Address: 192.168.21.134
Data storage directory: D:\osyunwei
2, rsync Client
System: CentOS 6.3
IP Address: 192.168.21.132
Synchronized Directories:/osyunwei
To achieve the purpose:
The rsync client automatically synchronizes the number of Cwrsyncserver
Rsync server and client configuration file the target server configuration file [rsyncd. conf] uidnobodygidnobodyusechrootnomaxconnections10strictmodesyespidfile/var/run/rsyncd. pidlockfile... rsync server and client configuration file the target
Installing rsyncPerform the following command installation:Apt-get install-y rsyncYou can then use the following command to see which files are installed:Dpkg-l rsyncConfiguring RsyncModify the corresponding content in the configuration file/etc/default/rsync as:Rsync_enable=trueAdd the configuration file/etc/rsyncd.conf, as follows:Port = 873UID = rootGID = rootUse chroot = yesRead Only = yesHosts allow=204.74.0.0/255.255.0.0Hosts deny=*Max connectio
Cross-server/client BACKUP command: rsync usage
Recently, we often need to deploy environments on a new server. Many things can be backed up directly from other servers without re-downloading and installing them.
The rsync command is used:
First, download rsync and instal
Requirements are as follows:Every night 0 o'clock on NFS Server A (rsync client), package the backup Site Program directory (/var/www/html)Push to Server B by using the rsync command to save the backupSpecific requirements:1.NFS servers and backup servers their backup directories are backups.2.NFS
These days to synchronize two servers, are Windows Server, I took my own computer to test Ah, after all, the server site is still in use, not blind, after two days of bitter often tried, and finally succeeded, and now share to everyone, to the next.Talk about the computer configuration and the use of the software bar:Service side:Windows7 System 64bit 4G memoryIP address is 192.168.1.13Cwrsyncserver_4.1.0_i
1. Perform rsync via SSH (password required)
Perform rsync through an SSH account (requiring a password) to mirror files synchronously to a remote server.The following example synchronizes the local/home/ramesh to the remote directory/backup/ramesh (server address 192.168.200.10).When you do the following, the server
Today, when synchronizing the data, prompt rsync:failed to set time on "xxxx": Operation is not permitted, generally speaking, if it is not the server time is incorrect or the permissions are not set, the following cloud Habitat Community Small series for everyone to organize some information
The first method:
The "XXXX" appears on the rsync:failed to set "s": Operation not permitted is largely due to the lack of operation permissions on the folder
Rsync server setup this solution uses the client to actively synchronize servers. server configuration: 1. create the mkdir/etc/rsyncdtouch/etc/rsyncd directory. conftouch/etc/rsyncd. secretschmod600/etc/rsyncd. s...
Rsync server construction
This solution uses the client to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.