rsync Sync specified directoryRsync uses the –include parameter and the –exclude parameter to synchronize the specified directory, and the –exclude directory is left behind.For example:Linux file directory
Copy Code code as follows:
Ls/usr/local/apache/htdocs/site
Aa
Bb
Cc
Dd
Ee
..
Zz
Just want to sync aa,bb,ee these three directories, other different steps.
Implementation code:
Copy Code code as follow
Rsync has several packaged tools on Windows, such as deltacopy and unison. After comparison, I still think cxrsync is best used.
Advantages of cwrsync:
1) easy configuration. Crgwin library files have been packaged, And you can directly call the command for Synchronization After download and installation.
2) You can operate on the command line. It is basically the same as on Unix (deltacopy is graphica
: This article describes how to record an rsync incremental synchronization of remote server files. For more information about PHP tutorials, see. Rsync remote shell incremental data synchronization
Rsync supports two methods to synchronize files. one is the daemon method (rsync
Rsync+inotify configuration of automatic backup server1 Backing up the server ip:192.168.1.106Client ip:192.168.1.1072.#yum-y install rsync xinetd gcc gcc-c++Install both of these services, as well as the C + + compiler (if not in advance, to avoid the compiler when compiling binary files)3. Create a rsyncd.conf on the server
Build the Rsync server architecture under centos6.x;1. Install rsyncYum Install-y rsync2.rsync configuration fileRsync server involves three configuration files: rsync.conf rsync.secrets RSYNC.MOTD#创建配置文件目录; Mkdir/etc/rsyncd#rsync service general configuration file; Touch rs
Rsync server synchronization error help-Linux general technology-Linux technology and application information, the following is a detailed description. [I = s] This post was last edited by szfhx
My ubuntu server (192.168.2.99) can use rsync to back up the directory locally, for example:
Su
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
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'
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
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 =/
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
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
First, the service side settings1. Modify server-side configuration# vi/etc/rsyncd.confModify:UID = Nobody # This option specifies the UID that the daemon should have when the module transmits the file. The default value is "nobody".GID = Nobody # This option specifies the GID that the daemon should have when the module transmits files. The default value is "nobody".Max connections = 4 # Maximum number of connections is 4Use chroot = no # no chrootLog
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.