win下自动获取一些文件

150阅读 0评论2021-07-07 brjl
分类:Windows平台


每天监控的数据,还要从多个地方获取,还要合并,实在是厌烦了
来吧,脚本带来的美好生活

  1. @echo off

  2. set yue=%date:~0,4%-%date:~5,2%
  3. set riqi=%date:~0,4%-%date:~5,2%-%date:~8,2%
  4. del /Q c:\data\*

  5. set datacenter1=xxx
  6. set ip=%datacenter1%
  7. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/mysql.csv c:\data\mysql1.csv
  8. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/mysql_tabspace.csv c:\data\mysql_tabspace1.csv
  9. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/oracle.csv c:\data\oracle1.csv
  10. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/oracle_asm.csv c:\data\oracle_asm1.csv

  11. rem 获取监控数据
  12. set dc2=yyy
  13. set ip=%dc2%
  14. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/mysql.csv c:\data\mysql2.csv
  15. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/mysql_tabspace.csv c:\data\mysql_tabspace2.csv
  16. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/oracle.csv c:\data\oracle2.csv
  17. certutil -urlcache -split -f http://%ip%/httpd/DatabaseCheck/%yue%/%riqi%/oracle_asm.csv c:\data\oracle_asm2.csv


  18. explorer C:\data

再挂到一个计划任务上,完美。
上一篇:如何查找进程的内存增加位置
下一篇:归档空间使用率达到90时,及时清理脚本