Reprinted: http://www.cnblogs.com/yanxiaodi/archive/2011/03/21/2296462.html
Server File synchronization Management
A few days ago, the power of a server went down. Fortunately, the data was not lost. Therefore, you must back up the Server File Content. The server is mainly used to provide website services. With a database, the database can be distributed and subscribed. The Web file development computer also has backups. Therefore, the focus is on the uploaded files.
The method of manually uploading and copying backups is obviously not feasible. You need to automatically synchronize uploaded files to another server.
We found a free open-source file synchronization tool: Freefilesync, official home http://sourceforge.net/projects/freefilesync/, which also comes with a real-time syncProgramRealtimesync.exe, You need to first set the synchronization of the main program, export the configuration file into a batch by using "advanced"-"create batch job" in the menu, (You can also refer to this method to directly write the batch processing: http://blog.csdn.net/shenzaohui/archive/2010/02/03/5284646.aspx) then use realtimesync.exe to import this configuration file, set the interval, You can automatically synchronize. However, this is not really real-time synchronization, and the biggest problem is that it needs to be compared again during each synchronization. It's okay if there are fewer files. If there are more files, there is no feasibility. See the http://www.rjno1.com/best/9-system/186-freefilesync for detailed usage of this program
Therefore, you need to find a program that can monitor file changes in real time. Find another one,Dsynchronize, authorHome PageHttp://dimio.altervista.org/eng/To download the latest version and Chinese Language Pack. After downloading the trial, you can implement real-time monitoring. When a file changes in the source directory, it is automatically synchronized to the target directory.
. Net hasThe filesystemwatcher class can implement this function. If you are free, study it in detail. This page has a rough idea of implementation andSource code: Http://www.cnblogs.com/xtigmh/articles/1037818.html
File Download http://files.cnblogs.com/zfanlong1314/dsynchronize%E4%B8%AD%E6%96%87%E7%89%88.zip
A few days ago, the power of a server went down. Fortunately, the data was not lost. Therefore, you must back up the Server File Content. The server is mainly used to provide website services. With a database, the database can be distributed and subscribed. The Web file development computer also has backups. Therefore, the focus is on the uploaded files.
The method of manually uploading and copying backups is obviously not feasible. You need to automatically synchronize uploaded files to another server.
We found a free open-source file synchronization tool: Freefilesync, the official home page http://sourceforge.net/projects/freefilesync/, this also comes with a real-time synchronization program realtimesync.exe, You need to first set the synchronization of the main program, export to a batch configuration file through the "advanced"-"create batch job" menu (you can also refer to this method to directly write the batch: http://blog.csdn.net/shenzaohui/archive/2010/02/03/5284646.aspx) then use realtimesync.exe to import this configuration file, set the interval to automatically synchronize data. However, this is not really real-time synchronization, and the biggest problem is that it needs to be compared again during each synchronization. It's okay if there are fewer files. If there are more files, there is no feasibility. See the http://www.rjno1.com/best/9-system/186-freefilesync for detailed usage of this program
Therefore, you need to find a program that can monitor file changes in real time. Find another one,Dsynchronize, authorHome PageHttp://dimio.altervista.org/eng/To download the latest version and Chinese Language Pack. After downloading the trial, you can implement real-time monitoring. When a file changes in the source directory, it is automatically synchronized to the target directory.
. net has a filesystemwatcher class, which can be implemented. If you are free, study it in detail. This page has the approximate implementation idea and source Code : http://www.cnblogs.com/xtigmh/articles/1037818.html