rsync 操作日记

来源:互联网 发布:gba编程 编辑:程序博客网 时间:2024/06/15 02:29

一.服务器配置
1. yum install rsync
vim /etc/xinetd.d/rsync
disable = no
2.vim /etc/rsyncd.conf


log file = /var/rsyncd.log
pid file = /var/rsyncd.pid
lock file = /var/rsyncd.lock
secrets file = /etc/rsyncd.pas
motd file = /etc/rsyncd.motd
read only = no
hosts allow = *
list = yes
uid = root
gid = root
use chroot = no
max connections = 30
[bak]
path = /home/zrb/tmp
comment = www bak
auth users = root


3. vim /etc/rsyncd.pas
root:pawwrord
chmod 600 rsync.pas
4./etc/rsyncd.motd
go
5.rsyncd --daemon 


6.ps aux | grep rsyncd


二.客户端配置
配置rsync client
1、设定密码
# vi /etc/rsync.pas
111111
修改权限
# cd /etc
# chown root.root rsync.pas
# chmod 600 rsync.pas
 
2、client连接SERVER
  从SERVER端取文件
# rsync -vzrtopg --progress --delete root@192.168.10.133::bak /home/testSync/ --password-file=/etc/rsync.pas
 
  向SERVER端上传文件
# rsync -vzrtopg --progress --password-file=/etc/rsync.pas  /home/testSync/ root@192.168.10.133::bak


1 0
原创粉丝点击