lsyncd 璁板綍

#棣栧厛瀹夎渚濊禆搴
yum install lua lua-devel

#鐒跺悗centos鍦ㄧ嚎瀹夎lsyncd闇瑕佸厛瀹夎epel-release鎵╁睍鍖
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install lsyncd
#瀹夎瀹屾垚涔嬪悗鎵撳紑閰嶇疆鏂囦欢
vi /etc/lsyncd.conf

settings {
        logfile ="/var/log/lsyncd/lsyncd.log",
        statusFile ="/var/log/lsyncd/lsyncd.status",
        inotifyMode ="CloseWrite",
        maxProcesses = 7,
        -- nodaemon =true,
        }
sync     {
        default.rsync,
        source = "/a/domains/jiajuz.com/public_html",
        target = "root@47.104.15.221::jiajuz",
        delete="running",
        -- excludeFrom = "/etc/rsyncd.d/rsync_exclude.lst"
        exclude = {
                "/a/domains/jiajuz.com/public_html/data",
                "/a/domains/jiajuz.com/public_html/includes/kindeditor/attached/image",
                "/a/domains/jiajuz.com/public_html/temp",
          },
        maxDelays = 5,
        delay = 30,
        rsync     = {
                binary = "/usr/bin/rsync",
                archive = true,
                compress = true,
                password_file = "/etc/rsyncd.passwd",
                -- bwlimit   = 2000
                -- rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
                -- 濡傛灉瑕佹寚瀹氬叾瀹冪鍙o紝璇风敤涓婇潰鐨剅sh
          }
        }

lsyncd.conf閰嶇疆閫夐」璇存槑

settings

閲岄潰鏄叏灞璁剧疆锛–寮澶磋〃绀烘敞閲婏紝涓嬮潰鏄嚑涓父鐢ㄩ夐」璇存槑锛

sync

閲岄潰鏄畾涔夊悓姝ュ弬鏁帮紝鍙互缁х画浣跨敤maxDelays鏉ラ噸鍐檚ettings鐨勫叏灞鍙橀噺銆備竴鑸涓涓弬鏁版寚瀹歭syncd浠ヤ粈涔堟ā寮忚繍琛岋細rsync銆乺syncssh銆乨irect涓夌妯″紡锛

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞