- @echo off
- set ftpUser=xxx
- set ftpPass=XXX
- set ftpIP=xxx
- set ftpFolder=/path/
- set DownFolder=F:\path\
- >"%tmp%\MyDel.vbs" echo dt=date()-1
- >>"%tmp%\MyDel.vbs" echo s=right(year(dt),4) ^& right("0" ^& month(dt),2) ^& right("0" ^& day(dt),2)
- >>"%tmp%\MyDel.vbs" echo wscript.echo s
- for /f %%a in ('cscript /nologo "%tmp%\MyDel.vbs"') do set yesterday=%%a
- set ftpFile=%temp%\TempAcc.txt
- >"%ftpFile%" echo %ftpUser%
- >>"%ftpFile%" echo %ftpPass%
- >>"%ftpFile%" echo cd "%ftpFolder%"
- >>"%ftpFile%" echo bin
- >>"%ftpFile%" echo mget DSTAT_1PASS.*.%yesterday%*.txt
- >>"%ftpFile%" echo bye
- start ftp -v -i -s:"%ftpFile%" %ftpIP%
-
- rem 根据实际情况自行调节延迟时间
- ping -n 600 127.1 >nul
-
- move /y DSTAT_1PASS.*.%yesterday%*.txt "%DownFolder%"
复制代码
|