How to create a folder named after the current day in the batch processing for one-day backup of mysql data generated by batch processing and save the generated SQL file in the folder {code ...} how to Create
Folder named on the day
And save the generated SQL file in the folder.
@echo offset "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"D:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump --opt -u root --password=123456 anna > E:\crontab\mysql\sql\bbs_anna%Ymd%.sqlD:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump --opt -u root --password=123456 typecho > E:\crontab\mysql\sql\bbs_typecho%Ymd%.sql@echo on
Reply content:
How to CreateFolder named on the day
And save the generated SQL file in the folder.
@echo offset "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"D:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump --opt -u root --password=123456 anna > E:\crontab\mysql\sql\bbs_anna%Ymd%.sqlD:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump --opt -u root --password=123456 typecho > E:\crontab\mysql\sql\bbs_typecho%Ymd%.sql@echo on
You only need to create a new directory. modify the directory as follows:
@ Echo off
Set "Ymd = % date :~, 4% % date :~ 5, 2% % date :~ 8, 2%"
Mkdir E: \ crontab \ mysql \ SQL \ % Ymd %
D: \ wamp \ bin \ mysql \ mysql5.5.24 \ bin \ mysqldump -- opt-u root -- password = 123456 anna> E: \ crontab \ mysql \ SQL \ % Ymd % \ bbs_anna. SQL
D: \ wamp \ bin \ mysql \ mysql5.5.24 \ bin \ mysqldump -- opt-u root -- password = 123456 typecho> E: \ crontab \ mysql \ SQL \ % Ymd % \ bbs_typecho. SQL
@ Echo on