当前位置:网站首页>Bash summary online log
Bash summary online log
2022-06-29 15:12:00 【Daiyuanpei】
#!/bin/bash
# date
if [ ! $1 ]; then
echo -e ' Date required , Examples :20220620'
exit;
fi
date=$1
# Total log file
logFile='/home/work/errorlog/error_'$date'.log'
# user
user='daiyuanpei'
# Delete the original log general act
rm -rf $logFile
# Get the... Of all machines ip And serial number
iplist=`get_instance_by_cloudapp -io projectName.pay`
#for The delimiter of is set to newline , It was originally a space and a newline
IFS=$'\n'
# Cycle all machines
for i in $iplist
do
# Get... For each machine ip And serial number
ip=`echo $i | awk '{print $2}'`;
offset=`echo $i | awk '{print $3}'`;
eachLogFile='/home/work/errorlog/log_'$offset'.log'
#scp hold log Copy the file
scp [email protected]$ip:/home/work/project-name/logs/$date/error.log $eachLogFile
# Judge that if it is not a file, it will jump out of this cycle
if [ ! -f "/home/work/errorlog/log_$offset.log" ];then
continue
fi
# Import each log into the total log
awk -v fileno=${offset} '{print fileno,"--",$0}' $eachLogFile >> $logFile
# Delete each small log file
rm -rf $eachLogFile
done边栏推荐
- 揭秘百度智能测试在测试自动执行领域实践
- How bad can a programmer be?
- Huashu high tech rushes to the scientific innovation board: the actual controller xuxiaoshu and his son, who plan to raise 660million yuan, are both American nationals
- 微信公众号—菜单
- What should phpcms do when it sends an upgrade request to the official website when it opens the background home page?
- phpcms打开后台首页时向官网发送升级请求觉得卡怎么办?
- 中国三氧化二砷行业研究与未来预测报告(2022版)
- FIFO implementation with single port RAM
- MCS:离散随机变量——Pascal分布
- 信息学奥赛一本通1001:Hello,World!
猜你喜欢

MCS:离散随机变量——几何分布

ROS notes (10) - Launch file startup

Lumiprobe 活性染料丨羧酸:Sulfo-Cyanine7.5羧酸

The first lesson on cloud - how easy is it to build a small broken station? The old driver of cloud computing will take you one hour to finish it

第九章 APP项目测试(4) 测试工具

Basic use of text preprocessing library Spacy (quick start)

Huashu high tech rushes to the scientific innovation board: the actual controller xuxiaoshu and his son, who plan to raise 660million yuan, are both American nationals

curl: (56) Recv failure: Connection reset by peer

华为软件测试笔试真题之变态逻辑推理题【二】华为爆火面试题

EMC-浪涌防护及退耦设计
随机推荐
微信公众号—菜单
Solution to the problem that the assembly drawing cannot be recognized after the storage position of SolidWorks part drawing is changed
What is the relationship between synchronized and multithreading
文本预处理库spaCy的基本使用(快速入门)
Illustration of Ctrip quarterly report: net revenue of RMB 4.1 billion has been "halved" compared with that before the outbreak
Asynchronous artifact completable future
nfs配置两台主机之间的文件映射
Lumiprobe reactive dye miscellaneous dye: BDP FL ceramide
Solidworks零件图存放位置更改后装配图识别不出来的解决办法
bash汇总线上日志
Intelligent diagnosis of Alzheimer's disease
Paper study -- accurate accounting of annual total runoff control rate considering the interannual variation characteristics of rainfall
curl: (56) Recv failure: Connection reset by peer
Indice d'évaluation du logiciel hautement simultané (site Web, interface côté serveur)
宜明昂科冲刺港股:年内亏损7.3亿 礼来与阳光人寿是股东
Lumiprobe click chemistry - non fluorescent alkyne: hexanoic acid STP ester
PyTorch 二维多通道卷积运算方式
The 5th China software open source innovation competition | opengauss track live training
SOFARegistry 源码|数据同步模块解析
Konva series Tutorial 4: drawing attributes