service nscd stop
#!/bin/bash
a=`date +%F-%H-%M`;
while read LINE;
do
sed -i "1s/^.*$/$LINE/" /etc/hosts;
mkdir /home/webscan/logs/$a;
wget www.xxx.com -O /home/webscan/logs/$a/$LINE.html;
done < /home/webscan/hosts
b=`grep 'xxxxx' /home/webscan/logs/$a/*|wc -l`;
echo $b;
if [ "$b" != "16" ]
then
echo 'hello!' | mailx -s "test" 632117384@qq.com;
fi
#!/bin/bash
a=`date +%F-%H-%M`;
while read LINE;
do
sed -i "1s/^.*$/$LINE/" /etc/hosts;
mkdir /home/webscan/logs/$a;
wget www.xxx.com -O /home/webscan/logs/$a/$LINE.html;
done < /home/webscan/hosts
b=`grep 'xxxxx' /home/webscan/logs/$a/*|wc -l`;
echo $b;
if [ "$b" != "16" ]
then
echo 'hello!' | mailx -s "test" 632117384@qq.com;
fi
本文介绍了一个使用Shell脚本进行批量下载指定网站页面的方法,并记录下载页面的数量。若数量不符预期,则通过邮件通知管理员。
1369

被折叠的 条评论
为什么被折叠?



