@echo offe
set date=%date:~0,4%-%date:~5,2%-%date:~8,2%
mysqldump -uroot -p123456 A B>D:\bak\"%date%".sql
rar.exe a -k -r -s -ml D:\bak\"%date%".sql.rar D:\bak:\"%date%".sql
del D:\bak:\*.sql
rar.exe a -k -r -s -ml D:\bak\"%date%"htdocs.rar D:\bak:\"%date%"htdocs
转载于:https://blog.51cto.com/fuwenchao/1338320