检测网站down掉后自动发信的shell脚本代码



#!/bin/bash
#website test scripts
while true;do
for cycle_temp in `cat url_list`
do
if lynx -dump `echo ${cycle_temp}` -accept_all_cookies|grep "true";then
echo "The website is running naturally"

else
echo "${cycle_temp} has been offline please attend it now!">/opt/test.txt
mail -v -s "website down mail" reterry123@163.com < /opt/test.txt
fi
done
sleep 2s
done

提取oralce当天的alert log的shell脚本代码
提取oralce当天的alertlog的shell脚本#/bin/sh#getalertofeveryday#thennameoffileiseveryday_alert.shdir="/oracle/admin/bbdz/bdump"num=$(cat-n${dir}/alert_bbdz.log|grep"`date|cut-c1-10`"|head-n1|aw

统计网卡流量的两段shell脚本(使用ifconfig)
使用shell脚本计算Linux网卡流量,方法中最关键点:ifconfig$eth_name|grepbytes|awk'{print$6}'|awk-F:'{print$2}'通过ifconfigeth0|grepbytes得到输入输出的流量。/@rac2=dd2$ifco

在指定目录查找指定后缀文件的shell脚本代码
#!bin/sh#在指定位置查找指定后缀的文件,包括子目录#用法:#findf$1$2#第一个参数为后缀#查找指定后缀的文件并打印出来#link:www.gimoo.net#date:2013/2/26f(){list=