[rsync]rsync设定及错误处理

摘要:
server端设置修改/etc/default/rsyncRSYNC_ENABLE=trueRSYNC_OPTS='--address=10.192.0.5'RSYNC_NICE=''修改/etc/rsyncd.conf#samplersyncd.confconfigurationfile#GLOBALOPTIONS#motdfile=/etc/motduid=nobodygid=nogroupu

QQ截图20140321180106

    • server端设置

修改/etc/default/rsync

RSYNC_ENABLE=true

RSYNC_OPTS='--address=10.192.0.5'

RSYNC_NICE=''

  • 修改/etc/rsyncd.conf

# sample rsyncd.conf configuration file

# GLOBAL OPTIONS

#motd file=/etc/motd
uid = nobody
gid = nogroup
use chroot = no
max connections = 10
strict modes = yes

log file=/var/log/rsyncd.log
# 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

[cashare]

comment = CA-Share
path = /home/cashare
uid = root
gid = root
read only = yes
hosts allow = 10.192.0.0/24
list = false
ignore erros
auth users = backup
secrets file = /etc/rsync.pass
transfer logging = yes
log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.

基本上配置还是比较好理解的了。

创建/etc/rsync.pass

chmod 600 /etc/rsync.pass

echo ‘backup:backup’ > /etc/rsync.pass

  • 客户端配置:

命令格式:

/usr/bin/rsync -vzrtopg --delete --progress backup@10.192.0.5::cashare /backup-10.192.0.5 --password-file=/etc/rsync.pass

写入到crontab

cat /etc/rsync.pass

backup

  • 犯得错误:

rsync: failed to connect to 192.168.1.106: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]

应该和下面原因相同

root@InnerServer3:/etc# rsync -vzrtopg --delete --progress gitlab@10.192.0.5:gitlab /backup-10.192.0.5/
gitlab@10.192.0.5's password:
Permission denied, please try again

ip之后应该是::而不是:,疏忽啊

@ERROR: auth failed on module gitlab
rsync error: error starting client-server protocol (code 5) at main.c(1534) [Receiver=3.0.8]

在client的密码文件中,只保存密码。

免责声明:文章转载自《[rsync]rsync设定及错误处理》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Cobbler自动化部署redis的主从复制下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Debian下安装NFS服务器

1.安装很简单 在Debian系统下安装NFS是相当简单的,在NFS服务器上执行下面的命令即可 # aptitude install nfs-kernel-server (会默认安装portmap和 nfs-common)  在客户端则需要安装:         # aptitude install nfs-common portmap 2.服...

解决Ubuntu DNS解析慢、上网速度慢

自从ubuntu升级到10.04后,上网速度感觉变慢了很多(ADSL),原因也众说分云,有说是firefox浏览器造成的,于是用chrome访问,速度依然很慢,可见不是由于浏览器造成的。 网速慢, 是因为浏览器在对DNS解析上花费了大量的时间,所以我们要做的工作就是加速DNS的解析。安装dnsmasq 第1步、 sudo apt-get install...

LINUX挂接UNIX系统NFS文件共享

类似于windows的网络共享,UNIX(Linux)系统也有自己的网络共享,那就是NFS(网络文件系统),下面我们就以SUN Solaris2.8和REDHAT as server 3 为例简单介绍一下在linux下如何mount nfs网络共享。   在linux客户端挂接(mount)NFS磁盘共享之前,必须先配置好NFS服务端。   1、Solar...

Keepalived+Nginx提供前端负载均衡+主从双机热备+自动切换

原文链接:http://unun.in/linux/156.html 方案: 采用两台Nginx服务器作为前端,提供静态web内容,分发web请求,一主一从,Keepalived实现状态监测,保证 Nginx正常对外提供服务,即主Nginx服务进程死掉之后,keepalived能够通过脚本或者程序检测机制,将网站的访问切换到从Nginx上 来。后端的web...

ubuntu14.04忽然不能登录,输入密码一直返回登录界面

解决方法: 1、ctrl + alt + F1进入命令终端 2、重装gdm,sudo apt-get install gdm 3、修改启动顺序:dpkg -reconfigure gdm 4、重启reboot可登录。   其他办法一: 1. 进入了登录界面后,不用输入密码,按住Ctrl+Alt+F1(听说F1~F6都行) 2. 进入了ub...

ubuntu init启动流程

ubuntu的init方式有两种:一种是System V initialization,一种是Upstart。ubuntu6.10以前的版本是第一种方式,之后的版本是第二种方式。 在旧式的System V initialization中,/etc/inittab文件可是相当的重要。init进程启动后第一时间就是找这个文件。它负责系统的初始化,设置系统的ru...