博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS 6.5下rsync学习记录
阅读量:7217 次
发布时间:2019-06-29

本文共 1343 字,大约阅读时间需要 4 分钟。

hot3.png

记录下自己服务器的配置文件rsync.conf

# Minimal configuration file for rsync daemon# See rsync(1) and rsyncd.conf(5) man pages for help# This line is required by the /etc/init.d/rsyncd script# GLOBAL OPTIONSuid = rootgid = rootuse chroot = noread only = yes#limit access to private LANshosts allow=114.215.239.111hosts deny=*max connections = 5pid file = /var/run/rsyncd.pidsecrets file = /etc/rsyn#lock file = /var/run/rsync.lock           motd file = /etc/rsyncd/rsyncd.motd#This will give you a separate log filelog file = /var/log/rsync.log#This will log every file transferred - up to 85,000+ per user, per synctransfer logging = yeslog format = %t %a %m %f %bsyslog facility = local3timeout = 300# MODULE OPTIONS[bill]path = /home/bill/list=yesignore errorsauth users = billcomment = David homeexclude = important/

使用场景

(1):rsync -avzP  bill@115.28.70.111::billModel /tmp/bill用bill 用户登录到服务器上,把billModel模块数据,同步到本地目录/tmp/bill上。(注意bill目录权限)(2):rsync -avzP --delete  bill@115.28.70.111::bill /home/cent引入一个 –delete 选项,表示客户端上的数据要与服务器端完全一致,服务器删除了,客户端也要删除(3):rsync -avzP --delete --password-file=/tmp/rsync.password bill@115.28.70.111::bill /home/cent -–password-file=rsync.password ,这时当我们以bill用户登录rsync服务器同步数据时, 密码将读取 /tmp/rsync.password 这个文件。这个文件内容只是bill用户的密码。rsync.password文件要有600权限 有点是在做定时脚本的时候就不需要人工输入密码了

转载于:https://my.oschina.net/731135090/blog/709291

你可能感兴趣的文章
pdfminer获取整页文本
查看>>
windows服务器多端口Redis安装步骤
查看>>
第二次作业心得
查看>>
爬虫——请求库之requests
查看>>
android子线程更新UI,与主Thread一起工作
查看>>
50行实现简易HTTP服务器
查看>>
细讲递归(recursion)
查看>>
进程和进程间通信
查看>>
微处理器的两种结构比较
查看>>
ORACLE EXPIRED(GRACE)
查看>>
Markdown应用样例
查看>>
多文本框的值得存放和赋值
查看>>
Linux中计划任务执行脚本crontab-简洁版
查看>>
Java - IO
查看>>
安卓app中嵌入一个H5页面,当手机系统设置字体变大时,如何使H5页面的字体不会随用户自己调整的系统字体变化而变化?...
查看>>
safari 收藏导出 手机safari 导出
查看>>
Dalvik 虚拟机 jvm 区别
查看>>
hexo从零开始
查看>>
币值转换
查看>>
RabbitMQ(六)远程连接
查看>>