1: Our company to do a "daily statistics offline film" application, I first put this function into a WinForm program to generate an EXE file
2: "Start-> program-> attachment-> System Tool" find it, open the Scheduled Tasks window
3: Double-click the Add Scheduled Tasks item to start the Scheduled Task wizard
4: Select the application to execute, here we choose to have the "statistics every day offline movie" function exe file
5: Enter the task name, you can use the default name or take a name you like, select the way the task is executed, we choose the "daily" item
6: Set the task start time and date, the default is the current time and date, we will start time to 9:00, that is, we work time
7: A new task is added to the Scheduled Tasks window by clicking the Finish button
Let's take a look at how the backup was first recorded. To copy the following lines of code into a. bat file (except in parentheses), execute the file on a daily schedule of execution.
The code is as follows |
Copy Code |
C:windowssystem32xcopy z:b-b-car.com d:b-b-car.combak/y/e |
(Y: No confirmation is required when replacing,
The code is as follows |
Copy Code |
Set mmdd=%date:~0,4%%date:~5,2%%date:~8,2% C:windowssystem32xcopy z:b-b-car.com d:b-b-car.combak%mmdd%/d/y/e |
(d: Directory f: File y: Replace without confirmation, E: Copy all files)
The automatic backup database can be used with the following commands, note that the database must have a password, because there is no password to be confirmed once, can not achieve the effect of automatic backup
code is as follows |
copy code |
Set mmdd=% date:~0,4%%date:~5,2%%date:~8,2% mysqldump-h192.168.1.46-ulinhaiquan-p123456 Db_bbcar > D:b-b-car.combakdatabasesdb_bbcar_ "%MMDD: =%" ". sql"   |