会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
New_Journey
真正的大师永远怀着一颗学徒的心!
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
11
下一页
2019年3月18日
chgrp命令
摘要: 选项
阅读全文
posted @ 2019-03-18 08:53 New_Journey
阅读(819)
评论(0)
推荐(0)
2019年3月16日
shell脚本批量创建用户
摘要: 其中用到的知识点: echo $RANDOM 随机生成一串数字 md5sum将某串数字或字符转成长串字符 cut -c 1-8 取1到8位字符
阅读全文
posted @ 2019-03-16 13:46 New_Journey
阅读(1256)
评论(0)
推荐(0)
检查主机存活状态脚本
摘要: #!/bin/bash ping_success_status() { if ping -c 1 $IP >/dev/null;then echo "$IP Ping is successful!" continue fi } IP_LIST="192.168.164.1 58.87.108.139"...
阅读全文
posted @ 2019-03-16 12:43 New_Journey
阅读(361)
评论(0)
推荐(0)
判断三次URL可用性脚本
摘要: #!/bin/bash check_url() { HTTP_CODE=$(curl -o /dev/null --connect-timeout 3 -s -w "%{http_code}" $1) if [ $HTTP_CODE -eq 200 ];then continue fi } URL_LIST="www...
阅读全文
posted @ 2019-03-16 12:40 New_Journey
阅读(263)
评论(0)
推荐(0)
检查URL的可用性脚本
摘要: #!/bin/bash check_url() { HTTP_CODE=$(curl -o /dev/null --connect-timeout 3 -s -w "%{http_code}" $1) if [ $HTTP_CODE -ne 200 ];then echo "Warning: $1 Access failure!" ...
阅读全文
posted @ 2019-03-16 12:39 New_Journey
阅读(409)
评论(0)
推荐(0)
监控硬盘使用率并发送邮件报警
摘要: #!/bin/bash DATE=$(date +%F" "$H:$M) IP=$(ifconfig | awk -F'[ :]+' NR==2'{print $4}') MAIL="13102133719@163.com" TOTAL=$(fdisk -l |awk -F'[: ]+' 'BEGIN{OFS="="}/^Disk \/dev/{printf "%s=%sG,",$2,$3}')...
阅读全文
posted @ 2019-03-16 12:33 New_Journey
阅读(319)
评论(0)
推荐(0)
监控内存利用率并发送报警邮件
摘要: #!/bin/bash DATE=$(date +%F" "%H:%M) IP=$(ifconfig eth0 | awk -F '[ :]+' '/inet addr/{print $4}') MAIL="13102133719@163.com" TOTAL=$(free -m | awk '/Mem/{print $2}') USE=$(free -m | awk '/Mem/{print ...
阅读全文
posted @ 2019-03-16 12:32 New_Journey
阅读(321)
评论(0)
推荐(0)
监控CPU使用率并发送报警邮件
摘要: #!/bin/bash DATE=$(date +%F" "%H:%M) #只支持centos6 IP=$(ifconfig eth0 | awk -F '[ :]+' '/inet addr/{print $4}') MAIL="13102133719@126.com" if ! which vmstat &>/dev/null; then echo "vmstat comma...
阅读全文
posted @ 2019-03-16 12:31 New_Journey
阅读(737)
评论(0)
推荐(0)
cut命令
摘要: 选项: 示例:以/etc/passwd为例来演示说明 例1: -f指定字段 打印1,6,7列的数据 选项-d是用来定义分隔符的 -f n-m意思是打印第n到第m个字段 --output-delimiter指定输出使用新的分界符 例: --complement 打印除了限制条件的所有列 例 选项-c的
阅读全文
posted @ 2019-03-16 10:56 New_Journey
阅读(234)
评论(0)
推荐(0)
2019年3月15日
du命令
摘要: 选项 例1:显示单个文件的大小(默认单位K) 例2:显示某个目录的总大小 例3:输出当前目录下各个子目录所用的空间
阅读全文
posted @ 2019-03-15 21:45 New_Journey
阅读(292)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
11
下一页
公告