![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
脚本
KTKong
简简单单
展开
-
常用的日志切割脚本,按大小,按时间
按大小切割#!/bin/bashtimeStamp=date '+%Y%m%d-%H%M%S'foldorpath=/opt/logs/nginxbakpath=/opt/logs/nginx_bakfor file in $( ls $foldorpath)dofile_len=stat $foldorpath/$file |grep Size |awk '{print $2}'if [ “$file_len” -ge “1073741824” ]; thencd $foldorpath原创 2020-12-30 16:17:10 · 580 阅读 · 0 评论 -
自动获取机器ip并加入ipv6配置脚本cd段版
#提取bond名ifconfig |grep bond[0-9].[0-9]|awk -F “:” ‘{print $1}’ > /tmp/bondnamefor i in cat /tmp/bondnamedo#c段iptypeset -u n3ipn3ip=ifconfig |grep -A 1 $i|grep inet|awk '{print $2}'|awk -F '.' '{print $3}'|xargs printf %xif [ echo $n3ip | wc -m =原创 2020-12-14 16:21:09 · 418 阅读 · 0 评论