1. Because you need to back up the Haina Yun Member Management System
2. At least one backup every day
3. Full backup
4. Backup Directory management
5. the backup name is named after the date.
6. automatic backup at every day
So I wrote the following bat script
Note: The premise of running the script is that mysql is installed, and the script is poorly written. Therefore, it is only applicable to database backup for small websites or databases with a small amount of data.
Record it here for future reference
Save the following text to D: \ hexin \ other \ hainayun \ hainayunbackup. bat
@ Echo off @ set filename = % Date :~ 0, 10% @ set dirname = % Date :~ 0, 7% @ set date_str = % Date :~ 0, 4%-% Date :~ 5, 2%-% Date :~ 8, 2% @ if "% time :~ 0% % "=" "(set time_str = Time :~ 1, 1%-% time :~ 3,2%-% time :~ 6, 2%) else (set time_str = % time :~ 0, 2%-% time :~ 3,2%-% time :~ 6, 2%) @ set dbback_file = % date_str % __% time_str % REM create a new month directory @ if % Date :~ 8, 2% = 01 (md d: \ Hexin \ other \ hainayun \ "% dirname %") if the current month directory does not exist, create the current month directory @ if not exist D: \ Hexin \ other \ hainayun \ "% dirname %" (md d: \ Hexin \ other \ hainayun \ "% dirname % ") echo ===================================================== ============= echo ..... backing up the data of the Haina Yun member management system. Please wait ...... echo .................. if you have any questions, please contact .................. echo ................... I am a fictitious person ................... echo ................. tel: 15882468644 .................. echo ................... QQ: 284466130 ................... echo ===================================================== ============ "D: \ Program Files \ mysql \ MySQL Server 5.1 \ bin \ mysqldump.exe "-uroot-p123456-p3306-H localhost javaidc_hainayun> D: \ Hexin \ other \ hainayun \ "% dirname %" \ "% dbback_file % ". SQL
In this way, the script for backing up the mysql database is ready.
Then add D: \ hexin \ other \ hainayun \ hainayunbackup. bat to the scheduled task.
WIN + R call out run input cmd press ENTER
Rem adds a scheduled task at/every: m, t, w, th, f, s, su D: \ hexin \ other \ hainayun \ hainayunbackup. batrem view scheduled task atrem delete scheduled Task 1 at 1/delete