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.