Back up database data of Haina Yun Member Management System (mysql/full backup)

Source: Internet
Author: User

 

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.