1: Network disk automatic backup (isolated backup)
Isolation Backup Introduction: Directly in the network set up projects, files to write the manuscript is likely to be with the network disk data is not synchronized to cause data loss integrity, file damage, so this way is not desirable. Therefore, isolated backup, the so-called isolated backup is written in a folder, when the computer is turned off automatically back up all the contents of a folder to the B folder (where b folder is the network disk directory)
After isolation, the manuscript and backup do not interfere with each other, double data. The process of achieving the goal is as follows:
1. When the network disk program running, automatically back up the contents of the Network Disk folder
2. Copy the contents of the folder that is currently being written to the network disk folder at shutdown
Data Test screenshot:
On the left side is the computer on the right side of the network disk, which is the automatic data backup when the computer is shut down.
Screenshot of network disk Generation folder
-----------------------------------------------------
The implementation process is as follows: Create a batch program code as follows:
Copy Code code as follows:
@echo off
Set "mydate=%date:~0,4% year%date:~5,2% month%date:~8,2% Day"
If exist "D:\ Jinshan fast disk \%mydate%*" (
ECHO has been backed up.
Exit
) Else (
Goto:back
)
: Back
net stop MSSQLServer
Set "now=%date:~0,4% year%date:~5,2% month%date:~8,2% Day%time:~0,8%"
Set "now=%now::=%"
Set "Now=%now: =%"
MD "D:\ Jinshan fast Disk \%now%"
xcopy D:\ Company Project \*.* d:\ Jinshan fast disk \%now%/e/h
Echo MD "D:\ Jinshan fast Disk \%now%"
Pause
(Note: Here I am backing up the database that contains the SQL, so I stopped the SQL service backup again, otherwise I can't copy the SQL database file)
How do I get this batch shutdown running after the batch process is written?
The following actions can be:
1: Start--run--input gpedit.msc then come out. Group Policy. Computer Configuration---Windows Settings---scripts (startup and shutdown) Double-click the shutdown policy, and then click Add--Browse to your batch file.
It's OK.
As shown in figure:
Done.