Automatically back up websites and databases, package and upload FTP servers and delete files in the first 30 days
Automatic backup of websites and databases Package and upload FTP servers and delete files from the first 30 days
@echo offnul
Set nowdate=%date:~0,10%
set nowdate=%nowdate:/=%
Md d:\autobak\"%nowdate:/=-%"\www
Md d:\autobak\"%nowdate:/=-%"\data
forfiles /p d:\autobak /d -30 /c "cmd /c del /f /q /a @path && rd /s /q @path"
xcopy d:\www d:\autobak\"%nowdate:/=-%"\www
xcopy d:\data d:\autobak\"%nowdate:/=-%"\data
cd c:\Program Files\WinRAR\
winrar.exe a -r d:\autobak\"%nowdate:/=-%".zip d:\autobak\"%nowdate:/=-%"\
Echo open 61.136.208.30 >ftp.up
Echo user >>ftp.up
Echo password >>ftp.up
Echo cd neibu-www\ >>ftp.up
Echo lcd D:\autobak>>ftp.up
Echo put "%nowdate:/=-%".zip >>ftp.up
Echo bye>>ftp.up
FTP -s:ftp.up
del ftp.up /q
pause & exit