服务器根据ip备份文件

@echo 
for /f "tokens=4" %%a in ('route print^|findstr 0.0.0.0.*0.0.0.0') do (
 set IP=%%a
goto :end
)
:end
@echo off
>tmp.vbs echo wscript.echo dateadd("d",-1,date())
for /f "tokens=1-3 delims=-/ " %%a in ('cscript //nologo tmp.vbs') do set/a y=%%a,m=100%%b,d=100%%c
del tmp.vbs&echo,%y%-%m:~-2%-%d:~-2%
for %%i in (D:\logs\nontaxServiceLogs\NonTaxSynchro\*%y%-%m:~-2%-%d:~-2%*.*) do "D:\Program Files\WinRAR\WinRAR.exe" a -m5 -ibck D:\logs\nontaxServiceLogs\NonTaxSynchro\%IP%" "%y%-%m:~-2%-%d:~-2%.rar %%i
Echo open ftpid地址>ftp.up
Echo 用户名>>ftp.up
Echo 密码>>ftp.up
:Echo Cd />>ftp.up
Echo binary>>ftp.up
Echo put D:\logs\nontaxServiceLogs\NonTaxSynchro\%IP%" "%y%-%m:~-2%-%d:~-2%.rar>>ftp.up
:copy %IP%" "%y%-%m:~-2%-%d:~-2%.rar D:\logs\nontaxServiceLogs\NonTaxSynchro\%IP%" "%y%-%m:~-2%-%d:~-2%.rar
Echo bye>>ftp.up
FTP -s:ftp.up
del ftp.up /q
:del D:\logs\nontaxServiceLogs\NonTaxSynchro\%IP%" "%y%-%m:~-2%-%d:~-2%.rar
pause
阅读更多

没有更多推荐了,返回首页