Rsync基础配置

  • Post author:
  • Post category:Rsync
  • Page Views 252 阅读

1.rsync安装

yum -y install rsync

2.配置/etc/rsync.conf   #没有可自行创建

uid = nobody
gid = nobody
use chroot = no
max connections = 500
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/run/rsyncd.log
exclude = lost+found/
transfer logging = yes
timeout = 900
ignore nonreadable = yes
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2

[rsync]                           #模块名字,随意写
path = /root/backuptest/ 
comment = ftp export area
ignore errors
read only = no
write only = no
hosts allow = *
list = false
uid = root
gid = root
auth users = backup
secrets file = /etc/rsyncd.passwd

3.创建/etc/rsyncd.passwd  

echo "backup:123"  >  /etc/rsyncd.passwd   #账号:密码,虚拟账号,无需创建实际账号
chmod 600 /etc/rsyncd.passwd  

4.启动守护进程

/usr/bin/rsync --daemon --config=/etc/rsyncd.conf

5.设置开机启动

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


「 文章如果对你有帮助,请点个赞哦^^ 」 

0

这篇文章有 3 条评论

评论关闭。