tsxmcwdegb 发表于 2016-6-8 12:33:46

ftp 收集日志文件 windows脚本

  1 定时任务  looptask.bat
  @echo off
setlocal ENABLEDELAYEDEXPANSION
set /a next_hour=0
set /a next_minute=0
for /F "tokens=1,2 delims=:" %%i in ('TIME /T') do (
set /a next_minute=%%j+5
set /a next_hour=%%i
if !next_minute! GEQ 60 (
set /a next_minute=!next_minute!-60
set /a next_hour=!next_hour!+1
if !next_hour! GEQ 24 set /a next_hour=!next_hour!-24
)
)
at !next_hour!:!next_minute! "F:\ftp\looptask.bat"
  at !next_hour!:!next_minute! "F:\ftp\ftpfiletrans.bat"
  
endlocal
@echo on
  
  2 ftp 执行脚本命令  ftpfiletrans.bat
  ftp   -i   -s:f:\ftp\fscript.txt  
  
  3  具体收集日志脚本  fscript.txt
  
  open 172.18.0.4  
root
root
bin  
put f:\ftp\wint.txt  
bye  
  
页: [1]
查看完整版本: ftp 收集日志文件 windows脚本