设为首页 加入收藏

TOP

[Linux] 搭建rsync服务端
2019-08-23 00:39:41 】 浏览:19
Tags:Linux 搭建 rsync 服务

 

rsync是unix/linux下同步文件的一个高效算法,它能同步更新两处计算机的文件与目录,并适当利用查找文件中的不同块以减少数据传输。

Linux守护进程的运行方式:
1.独立运行(stand-alone)的守护进程,独立运行的守护进程由init脚本负责管理
2.xinetd模式运行独立的守护进程

配置rsync服务端:/etc/rsyncd.conf主配置配件(默认不存在)

 

uid = root
gid = root
max connections = 4
read only = true
hosts allow = *
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
[data0]
path = /data0       //注意这里的目录
comment = test
read only = false
list = false
auth users = shihan1 //注意这里的用户名
secrets file = /etc/rsyncd.pas //用户名密码文件

vim /etc/rsync.pas 配置密码 , 远程rsync服务器的帐户密码文件的权限必须为600

chmod 600 /etc/rsync.pas

shihan1:12341234

运行rsync --daemon  

往主机推数据:  

rsync -avzP --delete /mnt/public/phpdev/187_test/2018-12-awk-uniq.txt shihan1@服务器ip::data0/

从主机拉数据:

rsync -avzP shihan1@服务器ip::data0/* .

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇PHP数字金额转换大写金额 下一篇[PHP] PHP多个进程配合redis的有..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目