rsync installation configuration

rsync, remote synchronize Gu think Italy will know it is a software to achieve remote synchronization feature, which at the same time file synchronization, you can keep the original file permissions, additional information on the time, soft and hard links. rsync is "rsync algorithm" provides a quick method for synchronizing files a client and a remote file server, but also can transfer files via ssh way, so confidentiality is also very good, while it's free software. Here talk rsync installation configuration, the common operations rsync. 1, ready Version: 3.0.7 Website: http: //www.samba.org/ftp/rsync/ Download: http: //www.samba.org/ftp/rsync/rsync-3.0.7.tar.gz 2, download and install # cd / usr / local / src / tarbag / // switch download directory # wget // wget to download files http://www.samba.org/ftp/rsync/rsync-3.0.7.tar.gz # tar -xzvf rsync-3.0.6.tar.gz -C ../software/ // extract the tar packets to the specified directory # cd / usr / local / src / software / rsync-3.0.6 / // switch to decompress Catalog # ./configure --prefix = / usr / local / rsync -disable-ipv6 // configure # make && make install // compiler installation 3, server-side configuration # vi rsyncd.conf log file = / usr / local / rsync /var/rsyncd.log // log file pid file = /usr/local/rsync/var/rsyncd.pid // pid file path lock file = /usr/local/rsync/var/rsyncd.lock // designated lock file secrets file = / usr / local / rsync / etc / rsyncd. 0/24 list = yes uid = nobody gid = nobody use chroot = no max connections = 30 [bak] path = / bak comment = www bak auth users = root --------------- -------------------------------------------- # vi rsyncd.pas / / user password files, with ":" separated bak: 123456 (save and exit) # chmod 600 rsyncd.pas // permissions must be 600 or an error occurs # vi rsyncd.motd // configure welcome message welcome to rsync 161 # rsync --daemon --config = / usr / local / rsync / etc / rsyncd.conf 3, client configuration # vi /etc/rsyncd.pas 123456 #chmod 600 /etc/rsyncd.pas // just passwords, permissions must is 600 # rsync -avH --progress --delete --password-file = / etc / rsyncd.pas / ftpdata / client / [email protected] :: bak explained: --delete: bak module is not present in the client the presence of files will be deleted --password-file: server-side matches the password file / ftpdata / client /: directory synchronization source [email protected] :: bak: synchronization target module, and realize the function as a root server to authenticate a user: all files in the local directory / ftpdata / client / synchronous ( Copied) to the directory module within the bak rsync 192.168.50.161 on this server. Precautions: 1, rsync server must exist 2, rsyncd bak this real client and the server. pas file permissions must be 600 3, Secrets file path must be correct, otherwise the log will be prompted for the password file does not exist 4, Uid and Gid If nobody, group owner and all the modules must be changed to nobody 5, rsyncd.pas different users within the system password and password, the user password to the server, and the client is only 6 password, the user password may be a plurality of server-side rsyncd.pas, rsyncd.pas only one client password 7, there are several questions to view the log synchronization method in /usr/local/rsync/var/rsyncd.log: Rsync -anH local directory remote IP: specific directory (the root password prompt after the carriage return, the equivalent of copies) such as: Rsync - avH / usr / local / src 192.168.0.2:/bak/test/ - "the whole src directory copying in the test Rsync -avH / usr / local / src / 192.168.0.2:/bak/test/ -> the src directory copy all the files into a test rsync -anH remote IP: specific directory local directory -> remote synchronized to the local need the root password rsync -anH rsync user @IP :: module local directory -> from the server module to synchronize local directory Note: with Common problems and solutions http://blog.chinaunix.net/uid-26569333-id-3067813.html

Reproduced in: https: //my.oschina.net/766/blog/211020

Guess you like

Origin blog.csdn.net/weixin_33874713/article/details/91546617