Rsync 3.1.1 source code compilation and installation configuration, rsync3.1.1
Http://rsync.samba.org/rsync-3.1.1.tar.gz---0.uninstall rpm# yum remove rsync ----- 1. installation: tar-zxvf rsync-3.1.1.tar.gzcd rsync-3.1.1. /configure-prefix =/usr/local/rsync -- disable-ipv6makemake installln-s/usr/local/rsync/bin/rsync/usr/local/bin/rsync ---- 2. server Configuration # vi/usr/local/rsync/rsyncd. confpid file =/var/run/rsyncd. pidport = 873pid = rootgid = rootuse chroot = nomax connections = 200 timeout 600 lock File =/var/run/rsyncd. locklog file =/var/run/rsyncd. logsecrets file =/usr/local/rsync/rsyncd. secrets motd file =/etc/rsyncd. motd [test] path =/test/ignore errorsread only = truelist = falsehosts allow = * # hosts deny = 0.0.0.0/32 auth users root # This user system exists and specifies the backup directory has the permission to comment = ocpyang test # vi/usr/local/rsync/rsyncd. motd ++ Wlecome to ocpyang rsync services ++ ++ -- Specifies the rsync access password, the password does not need to be the same as the password of the System Account # vi/usr/local/rsync/rsyncd. secrets root: snow01ln-s/usr/local/rsync/rsyncd. conf/etc/rsyncd. confln-s/usr/local/rsync/rsyncd. motd/etc/rsyncd. motdln-s/usr/local/rsync/rsyncd. secrets/etc/rsyncd. secretschmod 600/usr/local/rsync/rsyncd. secretschwn root: root/usr/local/rsync/rsyncd. secrets starts rsync #/usr/bin/rsync -- daemon -- config =/ Etc/rsyncd. conf # echo "/usr/bin/rsync -- daemon -- config =/etc/rsyncd. conf ">/etc/rc. d/rc. local # cat/etc/rc. d/rc. local #! /Bin/sh # This script will be executed * after * all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch/var/lock/subsys/local/usr/bin/rsync -- daemon # netstat-lntp | grep 873tcp 0 0 0.0.0.0: 873 0.0.0.0: * LISTEN 10689/rsync tcp 0 0:: 873: * LISTEN 10689/rsync -- create a test file # dd if =/dev/zero of =/test/t01.file bs = 1 M coun T = 50 # pkill rsync ---- 3. client Server Configuration (1 ). create a client password file (without the user name) # vi/etc/rsyncd. secretssnow01 # chmod 600/etc/rsyncd. secretsrsync-vzrtopg -- progress -- delete root@192.168.5.189: test/ocpyang/rsync-vzrtopg -- progress -- delete root@192.168.5.189: test/ocpyang/-- password-file =/etc/rsyncd. pwd (3 ). create a synchronization script # vi/rsync. sh #! /Bin/bash rsync-vzrtopg -- progress -- delete root@192.168.5.189: test/testbak/rsync-vzrtopg -- progress -- delete root@192.168.5.189 :: test/testbak/-- password-file =/etc/rsyncd. pwd (4 ). manually Synchronize files # cd /#. /rsync. sh (5 ). automatic synchronization: Synchronize every five minutes # crontab-e0, 5 */rsync. sh
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.