首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

目录共享有关问题

2012-03-19 
目录共享问题求助!在linux两个目录怎么实现互相镜像?比如在一个目录加文件 另一目录相应增加[解决办法]没

目录共享问题求助!
在linux两个目录怎么实现互相镜像?比如在一个目录加文件 另一目录相应增加

[解决办法]
没弄过 不知道下面的能否解决你的问题
http://doc.linuxpk.com/41302.html
http://www.163er.com/Server/Linux/58004.shtml
[解决办法]
这样可以不?

[root@test2]# sh test.sh test1 test2
test1 test2

[root@test2]# cat test.sh
echo $1 $2
while true
do
ls $1>$1.txt
ls $2>$2.txt

comm $1.txt $2.txt -1|while read name
do
cp $2/$name $1
done

comm $1.txt $2.txt -2|while read name
do
cp $1/$name $2
done
sleep 5
done

[解决办法]
用inotify+rsync可以实现文件的实时同步。不了解的可以QQ加我41031962

热点排行