Automatic data backup solution

Source: Internet
Author: User

1: automatic network disk backup (isolated backup)

Description of isolated backup: creating a project or file in the online storage directly for write operations may lead to data loss integrity and file damage due to non-synchronization with the online storage data, therefore, this method is not advisable. Therefore, isolated backup is used. The so-called isolated backup is to write A draft in the folder. When the computer is disabled, all the content in the folder is automatically backed up to the B folder (where the B folder is the Network Disk directory)

After the isolation, the writing and backup of the draft do not interfere with each other, and the dual data. The procedure is as follows:

1. When the network disk is started, the program runs and automatically backs up content in the Network Disk folder.

2. Copy the folder content written in the current draft to the online storage folder when shutdown.

Data test:

On the left is the local machine on the right side of the network disk, which is the data backup automatically when the instance is shut down.

Network Disk generation folder

-----------------------------------------------------
The implementation process is as follows: the code for creating a batch processing program is as follows:

Copy codeThe Code is as follows: @ echo off
Set "mydate = % date :~ % Year % date :~ 5, 2% month % date :~ "
If exist "d: \ Kingsoft disk \ % mydate % *"(
Echo has been backed up.
Exit
) Else (
Goto: back
)
: Back
Net stop mssqlserver
Set "now = % date :~ % Year % date :~ 5, 2% month % date :~ 8, 2%, % time :~ 0, 8%"
Set "now = % now: = %"
Set "now = % now: = %"
Md "d: \ Kingsoft disk \ % now %"
Xcopy D: \ company project \ *. * D: \ Kingsoft disk \ % now %/e/h
Echo md "d: \ Kingsoft disk \ % now %"
Pause

(Note: I have stopped the SQL service before backing up the database that contains SQL. Otherwise, the SQL database file cannot be copied)
How can I shut down the batch processing after writing the batch processing?

Follow these steps:

1: start -- run -- enter gpedit. msc then came out with a group policy. computer Configuration --- windows Settings --- script (START and shut down) Double-Click Shutdown Policy, then click Add -- browse to your batch processing file.

You can.

Success.

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.