ITeye博客

ftp 收集日志文件 windows脚本

eagletony · 2011-11-29 15:32 · 日志 · ftp 收集日志文件 windows脚本 · 行业应用 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。