Schedule tasks to implement automatic backup files in Windows

Source: Internet
Author: User
Tags current time time and date

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"  

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.