内容简介:rsync是类unix系统下的数据镜像备份工具——remote sync。一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH、rsync主机同步。
##配置流程:
####1、修改或创建 /log
uid = nobody
gid = nobody
use chroot = no
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[log]
path = /etc
uid = root
gid = root
read only = no
hosts allow = 内网IP,公网IP
hosts deny = 0.0.0.0/32
####2、启动 rsync
/usr/bin/rsync --daemon
重启 rsync
# 要 Kill rsync 进程,不要用 kill -HUP {PID} 的方式重启进程。
# ps -ef|grep rsync|grep -v grep|awk '{print $2}'|xargs kill -9
#也可以用
# cat /var/run/rsyncd.pid | xargs kill -9
# /usr/bin/rsync --daemon
####3、增加 rsync 开机启动
在 /etc/rc.local 增加
/usr/bin/rsync --daemon
####4、rsync 监听端口 873 ####5、 使用
客户端--->>服务端 (推) 客户端向 服务器 端推送文件 --delete 参数会删除服务器端中在客户端中没有的文件
/usr/bin/rsync -vrtup -R --delete /log root@192.168.1.114::log
客户端--->>服务端 (取) 客户端到服务端取文件 --delete 参数会删除客户端中在服务器端中没有的文件
/usr/bin/rsync -vrtup -R --delete root@192.168.1.114::log /log
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Code Reading
Diomidis Spinellis / Addison-Wesley Professional / 2003-06-06 / USD 64.99
This book is a unique and essential reference that focuses upon the reading and comprehension of existing software code. While code reading is an important task faced by the vast majority of students,......一起来看看 《Code Reading》 这本书的介绍吧!