这篇“Ubuntu下如何配置Rsync服务”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Ubuntu下如何配置Rsync服务”文章吧。
默认情况ubuntu安装了rsync服务,但在/etc下没有配置文件,一般情况可以copy示例文件到/etc下
#cp /usr/share/doc/rsync/examples/rsyncd.conf /etc
#vi /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.
pid file=/var/run/rsyncd.pid
syslog facility=daemon
#socket options=
# module options
[rsync]
comment = public archive
path = /home/soft/rsync
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
修改看个人情况,一般修改path=/home/soft/rsync为自己的目录
修改完后在/etc/下新建一文件rsyncd.pass
#vi /etc/rsyncd.pass
backup:backup
:wq
修改rsyncd.pass权限
#chmod 600 /etc/rsyncd.pass
现在就可以启动rsync了
#rsync --daemon
启动成功后可以用lsof -i:873是否正常启动,也可以查看/var/log/rsyncd相关日志文件。
备份命令:rsync -vzrtopg --progress --delete backup@172.28.156.88::rsync /cygdrive/f/a
注:cygdrive/f/a即表示f:a目录
详细格式说明:
-v,
版权声明:除特别声明外,本站所有文章皆是本站原创,转载请以超链接形式注明出处!