linux定时任务访问页面代替quartz集群
0 1 * * * root /dbdata/backup/cms/async.sh
#!/bin/bash
Dir="/home/webtrn/CrontabDir"
echo `date +"%Y-%m-%d-%H-%M"` >> $Dir/checklearntime.log
wget -t1 http://www.baidu.com/checkserver/XXX.jsp -o $Dir/wgetchecklearntime.log
grep -q "404" $Dir/wgetchecklearntime.log || grep -q "302" $Dir/wgetchecklearntime.log
if [ $? != 0 ]; then
echo "checklearntime have done" >> $Dir/checklearntime.log
else
echo "checklearntime is error" >> $Dir/checklearntime.log
echo "checklearntime is error" | mail -s "webtrn" zhugaojian@whaty.com
echo "checklearntime is error" | mail -s "webtrn" jinqingwen@whaty.com
fi
rm -f XXX.jsp
rm -f $Dir/wgetchecklearntime.log
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。