Regularly compress the backup file (folder) and upload it to the backup server (BAT) through FTP)
Rem regularly backs up files and uploads them to the backup server over FTP
Rem folder to be backed up (Multiple folders are separated by spaces)
Set bak_webfile = E: \ sman \ webfile E: \ sman \ datafile
Rem Temporary Folder
Set bak_tmpfile = c :\~ Smantemp \
Rem log folder
Set bak_logpath = c :\~ Bak_log \
RAR file name generated by Rem
Set bak_bakfile = yyyymmdd (page backup)
Rem current date (Format: yyyymmdd)
Set bak_date = % Date :~ 0, 4% % Date :~ 5, 2% % Date :~ 8, 2%
Rem FTP Information
Set bak_ftpserver = 127.0.0.1 88
Set bak_ftpusername = test
Set bak_ftpuserpass = 123
Set bak_timestart = % time %
MD % bak_tmpfile %
MD % bak_logpath %
Echo -------- start to compress [% bak_timestart %]> %bak_logpath1_log-baibak_date1_.txt
"C: \ Program Files \ WinRAR \ rar.exe" a-Ag + % bak_bakfile % bak_tmpfile % bak_webfile %
Echo -------- after compression is completed, start uploading [% time %/% bak_timestart %] >>% bak_logpath#log-?bak_date=.txt
Rem generates an FTP command file
Echo open % bak_ftpserver %> ftp. sman
Echo % bak_ftpusername %> ftp. sman
Echo % bak_ftpuserpass %> ftp. sman
Echo bin> ftp. sman
Echo mkdir % bak_date %> ftp. sman
Echo cd % bak_date %> ftp. sman
Echo mput % bak_tmpfile % \ *> ftp. sman
Echo bye> ftp. sman
FTP-S: ftp. sman-I> % bak_logpath‑log-‑bak_date‑.txt
Del ftp. sman/Q
Rem xcopy % bak_tmpfile % * c: \ Temp/y
Del % bak_tmpfile % *. */Q/s
Rd % bak_tmpfile %/Q
Echo -------- uploaded [% time %/% bak_timestart %]> % bak_logpath1_log-baibak_date0000.txt