tonnyom < tonnyom@hotmail.com >
版权声明:可以任意转载,转载时请务必以文字形式标明文章原始出处和作者信息及本声明.
Server IP:172.18.5.251 Hostname: freebsd-1
Client IP:172.18.5.247 Hostname: freebsd-2
apache_1.3.29
rsync-2.5.7
Step 1: 安装
Step 3: 配置rsyncd.conf
[www]
comment = web server backup
path = /usr/local/www/data-dist
auth users = tonny
uid = nobody
gid = nogroup
secrets file = /usr/local/etc/rsyncd.secrets
read only = no
tonny:123456 // 认证所需的用户名/密码
freebsd-1#chmod 600 rsyncd.secrets
rsyncd_enable="YES"
command_args="-4 --daemon" <<<--- 启用ipv4 协议
freebsd-1#/usr/local/etc/rc.d/rsyncd.sh start
二,Rsync Client
Step 1: 安装
123456 //Rsync Server上的认证密码,不用输入用户名
freebsd-2#chmod 600 rsyncd.secrets
Step 5: Auto Rsync Shell:
freebsd-2#chmod a-x rsyncd.sh
freebsd-2#vi rsync.sh //加入以下内容
#!/bin/sh
/usr/local/bin/rsync -avzP --delete
--password-file=/usr/local/etc/rsyncd.secrets tonny@172.18.5.251::www
/backup/www/
freebsd-2#chmod a+x rsync.sh
freebsd-2#crontab -e //加入以下内容(每天下午5点半自动备份同步)
30 17 * * * /usr/local/etc/rc.d/rsync.sh
三,高级应用(Rsync With SSH)
Rsync Server
Rsync Client
freebsd-2#scp ~/.ssh/id_dsa.pub 172.18.5.251:/root/.ssh/authorized_keys
freebsd-2#ssh-agent csh 或 (ssh-agent bash) --->>> #echo $SHELL
查看当前SHELL
freebsd-2#ssh-add id_dsa --->>> 输入 passphase
freebsd-2#/usr/local/bin/rsync -avzP --delete -e ssh
172.18.5.251:/usr/local/www/data-dist/ /backup/www/
PS: 参数说明
-a, --archive archive mode, equivalent to -rlptgoD
//档案模式
-v, --verbose
//详细模式
-z, --compress compress file data
//压缩文件
-P equivalent to --partial --progress
//显示进度
--delete
This tells rsync to delete any files on the receiving side
that
aren't on the sending side.
//保持远程机器的文件同步性
-e ssh use SSH connection
//使用SSH连接,保证数据安全
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/openssh.html
freebsd handbook手册
首先,rsync 作为push方式(server to client) 也是可行的.
另外你的问题,关键只是在于对于新文件的判断(可以通过写shell,或者其他方式实现),至于rsync不管是pull方式,还是push方式,那就无所谓了.
You can use UNISON mirror tools.
那复制到客户机的磁带机上也可以同样的操作?
反正FREEBSD对所有的设备当作目录处理的。
hotel londra
hotel milano
hotel parigi
hotel roma
hotel venezia
albergo roma
hotel barcellona
hotel nizza
prenotazione hotel milano
prenotazione hotel roma
alberghi venezia
albergo venezia
monitor lcd
balazzo bauer
portatili usati
http://hotel-londra.has.it
http://hotel-milano.has.it
http://hotel-parigi.has.it
http://hotel-roma.has.it
http://hotel-venezia.has.it
http://albergo-roma.has.it
http://hotel-barcellona.has.it
http://hotel-nizza.has.it
http://prenotazione-hotel-milano.has.it
http://prenotazione-hotel-roma.has.it
http://alberghi-venezia.has.it
http://albergo-venezia.has.it
http://monitor-lcd.has.it
http://palazzo-bauer.has.it
http://portatili-usati.has.it
本功能正在开发中,目前不能使用,敬请原谅。
√ 期刊在线投稿: /journal/contribute.html
√ 本文打印于《CNFUG期刊》,欢迎访问 http://www.cnfug.net 获取更多技术文章。
© 2003-2006 CNFUG(China FreeBSD User Group) All rights reserved.
Powered by FreeBSD
rsync是一种被动等带客户指令的同步。
我现在想实现的是
当server端一有文件变化(比如有新文件生成),自动的
能够使得将这些文件推送到客户端。
请问有办法吗?