搜索
首页php教程php手册linux|rsync的简单使用|rsyncd.conf

rsync是linux上一个同步文件的工具 http://rsync.samba.org 如果是要在windows上同步到linux上,则可以使用pscp http://www.chiark.greenend.org.uk CentOS ?php// /etc/rsyncd.confport = 873 //端口uid = www //用户 gid = www //用户组read only = no //这

rsync是linux上一个同步文件的工具
http://rsync.samba.org

如果是要在windows上同步到linux上,则可以使用pscp
http://www.chiark.greenend.org.uk CentOS
<?php
// /etc/rsyncd.conf

port = 873  //端口
uid = www   //用户  
gid = www   //用户组
read only = no  //这样就可以上传
use chroot = yes //这个默认就好
max connections = 2 //最多同时2个连接发生
log file = /var/log/rsyncd.log  
pid file = /var/run/rsyncd.pid

[webroot]
path = /data/webroot  //要备份的目录
comment = This purpose to backup wwwroot
auth users = www    //验证账号,可以有多个,用短号隔开
secrets file = /etc/rsyncd.secrets   //验证密码文件

// /etc/rsyncd.secrets
格式为:   账户:密码 [这里的密码最后系统的不同哟,自定义的]
比如:  www:mypassword
还要注意验证密码文件的权限为600[-rw-------]


// now, start rsync
启动rsync服务
rsync --daemon --config=/etc/rsyncd.conf   //守护进程

下载
rsync -vzrtopg --progress www@192.168.1.25::webroot /home/backup  //这里的webroot在conf中已经定义了

上传
rsync -vzrtopg --progress /home/backup root@192.168.1.25::webroot

在执行的时候会提示输入密码,则输入上面secrets中定义的mypassword
如果说修改了配置文件需要重载rsync的conf则可以这样

//  /etc/xinetd.d/rsync

service rsync
{
        disable = no
        flags           = IPv6
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}

把disable = no 改成 disable=yes

然后执行 /etc/init.d/xinetd restart  //如果启用过这个服务可以用reload
centos上好像默认没有这个xinetd服务,那么自己yum install xinetd就好了
Name        : xinetd
Arch        : x86_64
Epoch       : 2
Version     : 2.3.14
Release     : 39.el6_4
Size        : 259 k
Repo        : installed
From repo   : base
Summary     : A secure replacement for inetd
URL         : http://www.xinetd.org
License     : xinetd
Description : Xinetd is a secure replacement for inetd, the Internet services
            : daemon. Xinetd provides access control for all services based on the
            : address of the remote host and/or on time of access and can prevent
            : denial-of-access attacks. Xinetd provides extensive logging, has no
            : limit on the number of server arguments, and lets you bind specific
            : services to specific IP addresses on your host machine. Each service
            : has its own specific configuration file for Xinetd; the files are
            : located in the /etc/xinetd.d directory.
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
4 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

MinGW - 适用于 Windows 的极简 GNU

MinGW - 适用于 Windows 的极简 GNU

这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )专业的PHP集成开发工具