
shell脚本
diyiday
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
shell实时统计nginx日志tps情况
有个需求,需要实时统计日志中每隔接口的tps情况。 每次使用命令写太复杂了,于是写了一个脚本 #!/bin/bash list="queryCardList" info="queryInfo" while true; do sleep 1 s_time=`date -d '5 second ago' '+%H:%M:%S'` now_time=`date '+%Y-%m-%d '` list_no=`tail -n 50000 /nginx/access.log |grep $原创 2021-01-18 10:50:26 · 2019 阅读 · 0 评论 -
利用linux的dd命令生成指定大小的文件
有时候需要文件来测试,需要把文件设置为指定大小,在linux中很容易搞起: ubuntu@VM-0-15-ubuntu:~/taoge/cpp$ dd if=/dev/zero of=zeroFile bs=1K count=1 1+0 records in 1+0 records out 1024 bytes (1.0 kB, 1.0 KiB) copied, 0.000238263 s, 4.3 MB/s ubuntu@VM-0-15-ubuntu:~/taoge/cpp$ ll zeroFile -转载 2021-01-15 10:54:51 · 1777 阅读 · 0 评论 -
shell脚本监控主机cpu,内存,磁盘使用情况脚本
shell脚本监控主机cpu,内存,磁盘使用情况脚本 #! /bin/bash cd /home/groupop/checkServer if [ ! -f hostlist ];then exit 0; fi ip=""; types=""; > monitor.error.log; CPU_USED_PCT="93"; MEM_USED_PCT="92"; DISK_USE_PCT="80"; for line in `cat hostlist | grep -v '#'`原创 2020-09-07 16:05:03 · 1022 阅读 · 0 评论