日期:2014-05-17  浏览次数:20754 次

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??

?