开发的需求:需要把17-22号的error log 打包下来
从远程机器拷贝文件到当地
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/bash
##因为在这里log的文件名是以日期为名的。所以要定义一下。如果要18号的在这里更改为18就行
date
=`
echo
20160317{00..23}`
while
read
sip svr
do
for
filename
in
$
date
do
#echo -e "${sip} ${svr} ${filename} \n "
rsync
-zrtopg --password-
file
=
/etc/clientrsync
.pass gulong@${sip}::data
/services/gulong_server/
${svr}
/log/log/logsvr/error/
${filename}.log
/data/salt/version/
${svr}_${filename}.log
done
###iplist 里面记录了ip和游戏服的编号
done
<<<
"`cat /data/gulong/script/iplist | grep hunfu |awk '{print $1,$4}'`"
|
本文转自 shouhou2581314 51CTO博客,原文链接:http://blog.51cto.com/thedream/1753581,如需转载请自行联系原作者