shell实例:临时解决rsync自动断开的问题
#!/bin/bashrsync -avzP --timeout=60 -e "ssh -p X" X.X.X.X:/kejiandata/streams/tarena/streams/* /h
zdata/streams/
while ((1 < 100));do
ps aux | grep /kejiandata/streams/tarena/ | grep rsync | grep timeout
if [ `echo $?` -eq 1 ];then
rsync -avzP --timeout=60 -e "ssh -p X" X.X.X.X:/kejiandata/streams/tarena/stre
ams/* /hzdata/streams/
fi
sleep 30
if [ `date +"%H%M"` -ge 0830 ];then
exit
fi
done
页:
[1]