1、安装并编辑配置

apt install -y rsync
sed -i 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/g' /etc/default/rsync
#复制配置文件
cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/
vi /etc/rsyncd.conf

2、按需修改配置项

[backup]

    comment = data backup
    path = /mnt/backup
    use chroot = yes
#   max connections=10
    lock file = /var/lock/rsyncd
    read only = yes
    list = yes
    uid = nobody
    gid = nogroup
#   exclude = 
#   exclude from = 
#   include =
#   include from =
#   auth users = 
#   secrets file = /etc/rsyncd.secrets
    strict modes = yes
#   hosts allow =
#   hosts deny =
    ignore errors = no
    ignore nonreadable = yes
    transfer logging = no
#   log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
    timeout = 600
    refuse options = checksum dry-run
    dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz

标签: none

添加新评论