⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows下使用批处理实现对网站的监测.txt

📁 高手lxmxn收集的批处理。包括了批处理教程和他写的几十个很经典的代码。
💻 TXT
字号:
   
  您现在的位置: 华夏黑客同盟 >> 文章 >> 网管频道 >> 网站建设 >> 资讯正文  用户登录 新用户注册 
 
  
   
 
 
 
 
 
 
 
   
  Windows下使用批处理实现对网站的监测           ★★★ 【字体:小 大】 
 
  
   
   
 Windows下使用批处理实现对网站的监测 
 
作者:未知 文章来源:华盟收集 点击数:265 更新时间:2006-11-14 0:20:00 
 
 
    由于多数监测软件是商业性质,同时使用过一个付费的监测服务感觉效果并不理想,于是动手弄了一个自己的监测系统,使用DOS批处理操作。

原理:
    使用了一个Wget.exe 的Win32版本用以从网站下载文件,利用批处理命令检测文件是否抓取成功,如果成功,删除已经下载的文件,退出批处理,如果不成功,利用安装在电脑上的modem拨打某个电话号码,使用特定的振铃次数通知网站发生故障。

    测试后将批处理放到windows中的计划任务中周期执行。

注意:wget.exe需要放置到与批处理相同的目录,或者放入windows系统目录。

批处理文件:

monitor.bat
@echo off
echo.>>wget.log
rem 使用wget下载网页首页文件,并记录日志
.\wget -a wget.log -d http://www.xxx.com   
rem 判断index.html文件是否下载成功
if exist index.html goto end
echo.>>system.log
echo ---------------------------->>system.log
date/t>>system.log&&time/t>>system.log
echo error occurred>>system.log
rem 调用一个拨号批处理
call .\dial.bat
exit

:end
echo.>>system.log
echo ---------------------------->>system.log
date/t>>system.log&&time/t>>system.log
echo ok>>system.log
echo y|del .\index.html
exit 
dial.bat
@echo off
rem 使用at指令传送到串口拨号
echo atdtxxxxxxx >com1
rem 延时14秒,振铃3次
choice /c yn /d y /n /t 14 >nul 
rem 挂机
echo ath>com1
choice /c yn /d y /n /t 5 >nul 
echo atdtxxxxxxx >com1
choice /c yn /d y /n /t 14 >nul 
echo ath>com1
choice /c yn /d y /n /t 5 >nul
echo atdtxxxxxxx >com1
choice /c yn /d y /n /t 14 >nul 
echo ath>com1 
 
 
 
 
 
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -