@echo off
echo start backup……
set d=%date:~0,4%%date:~5,2%%date:~8,2%
set srcDir=D:\wwwroot\eolinker_os_4_0\
set dstDir=D:\wwwroot\bak\eolinker_os_4_0\
set name=%d%.rar
set name=%name: =%
"C:\Program Files\WinRAR\WinRAR.exe" a -k -r -s -m1 -agYYYYMMDD %dstDir% %srcDir%
rem ftp
set user=FtpUser
set pass=dd373
set ip=192.168.101.143
set RemoteFolder=eolinker_os_4_0
set LocalFolder=D:\wwwroot\bak\eolinker_os_4_0
set ftpFile=D:\wwwroot\bak\eolinker_os_4_0\ftp.txt
echo open %ip%>%ftpFile%
echo %user%>>%ftpFile%
echo %pass%>>%ftpFile%
echo cd %RemoteFolder%>>%ftpFile%
echo lcd %LocalFolder%>>%ftpFile%
echo binary>>%ftpFile%
echo put %name%>>%ftpFile%
echo bye>>%ftpFile%
ftp -s:"%ftpFile%"
echo backup is compate.
del %ftpFile%
pause