亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    rsync + inotify 文件同步

    rpm -e rsync-3.1.2-4.el7.x86_64 –nodeps

    rpm -ivh rsync-3.1.2-4.el7.x86_64.rpm

    115 服務(wù)端,接收文件的地方

    echo "web:123" > /usr/local/rsync/rsyncd.passwd

    vi /etc/rsyncd.conf

    # /etc/rsyncd: configuration file for rsync daemon mode

    # See rsyncd.conf man page for more options.

    uid = root

    gid = root

    use chroot = no

    max connections = 200

    timeout = 1000

    transfer logging = yes

    pid file = /var/run/rsyncd.pid

    lock file = /var/run/rsyncd.lock

    log file = /var/log/rsyncd.log

    log format = %t %a %m %f %b

    port = 873

    ignore errors

    #read only = yes

    #address = 192.168.248.136

    [web]

    path = /home/dqws_ftp/upload/

    read only = false

    write only = yes

    hosts allow = xxxxx

    hosts deny = *

    list = false

    auth users = web

    secrets file = /usr/local/rsync/rsyncd.passwd

    #read only = yes

    #exclude = test/ #不同步的目錄

    cd /usr/local/rsync

    chmod 600 rsyncd.passwd

    rsync –daemon

    echo "/usr/local/rsync/bin/rsync –daemon –config=/usr/local/rsync/rsyncd.conf" >> /etc/rc.local

    114 客戶端,發(fā)送文件的地方

    echo "123" > /usr/local/rsync/rsync.passwd

    cd /usr/local/rsync

    chmod 600 rsyncd.passwd

    /usr/bin/rsync -vzrtopg –progress –password-file=/usr/local/rsync/rsyncd.passwd /home/dqws_ftp/upload/ web@xxxxxx::web

    刪除安裝包

    rpm -ivh inotify-tools-3.14-8.el7.x86_64.rpm

    腳本

    #!/bin/bash

    host=xxxxxx

    src=/home/dqws_ftp/upload/

    des=web

    user=web

    /usr/bin/inotifywait -mrq –timefmt '%d/%m/%y %H:%M' –format '%T %w%f%e' -e modify,create,attrib $src | while read files

    do

    /usr/bin/rsync -vzrtopg –progress –password-file=/usr/local/rsync/rsyncd.passwd $src $user@$host::$des

    echo "${files} was rsynced" >> /data/logs/rsync.log 2>&1

    done

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)