We will use the scheduled tasks in windows to back up the database. 1. copy the folder to a fixed folder, and 2. copy the folder to the automatically generated folder on the current day:
1: Our company is going to create an application for "counting offline movies every day". I will first make this function into a WinForm program to generate an exe file.
2: Choose Start> program> attachment> System Tools to open the scheduled task window.
3: Double-click "add scheduled task" to start the "scheduled task wizard"
4: select the application to be executed. Here we select the exe file with the function of "counting offline movies every day ".
5: Enter the task name. You can use the default name or a name you like. Select the task execution method and select the "Daily" item.
6: Set the start time and date of the task. The default time is the current time and date. We will change the start time to, that is, the start time.
7. Click "finish". A new task is added to the "scheduled task" window.
Let's take a look at the backup file! Copy the following lines of code into a. bat file (except the brackets) and execute this file in the daily scheduled execution plan,
Copy codeThe Code is as follows: C: \ WINDOWS \ system32 \ xcopy Z: \ b-b-car.com D: \ b-b-car.combak/y/e
(Confirmation is not required for y: \ replacement,
Copy codeThe Code is as follows: set mmdd = % date :\~ 0, 4% % date :\~ 5, 2% % date :\~ 8, 2%
C: \ WINDOWS \ system32 \ xcopy Z: \ b-b-car.com D: \ b-b-car.combak % mmdd %/d/y/e
(Confirmation is not required when replacing d: \ directory f: \ file y: \, and e: \ copies all files)
The following command can be used to automatically back up a database. Note that the database must have a password, because you need to confirm the password again, and the automatic backup effect will not be reached.
Copy codeThe Code is as follows: set mmdd = % date :\~ 0, 4% % date :\~ 5, 2% % date :\~ 8, 2%
Mysqldump-h192.168.1.46-ulinhaiquan-p123456 DB_Bbcar> d: \ b-b-car.combak \ databases \ DB_Bbcar _ "% mmdd: = %" ". SQL"