rsync远程同步操作记录

本文详细介绍了rsync服务的配置文件rsyncd.conf的结构和各项参数含义,包括全局选项和模块选项。通过示例展示了如何配置rsync服务,如设置共享目录、权限、日志记录等,并提供了客户端操作rsync服务的命令示例。

sudo cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/
vi /etc/rsyncd.conf
sudo vi /etc/rsyncd.conf
sudo vi /etc/rsyncd.conf
sudo rsync --daemon --config /etc/rsyncd.conf
cat /etc/rsyncd.conf
zhangshoug@r810x01:~$ cat /etc/rsyncd.conf
# sample rsyncd.conf configuration file

# GLOBAL OPTIONS

#motd file=/etc/motd
#log file=/var/log/rsyncd
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
# The init.d script does its own pid file handling,
# so omit the "pid file" line completely in that case.
# pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=

# MODULE OPTIONS

[ftp]

    comment = public archive
    path = /var/www/pub
    use chroot = yes
#    max connections=10
    lock file = /var/lock/rsyncd
# the default for read only is yes...
    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

#客户端操作,拉取/var/www/pub
rsync -avz --progress -e 'ssh -p 4422' zhangshoug@proxy.luanhe.com:/var/www/pub /var/www/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值