| The technique of remote file synchronization which is getting more and more applications in modern enterprises can make files be consistent between remote hosts, implement the backup and recovery of remote files,establishment of Web mirrors and Web caching and so on. Currently there are some sophisticated remote one-way file synchronization softwares for Linux like "rsync". Those softwares provide stable file synchronizing function, however some problems still exist in such system. First of all, they cannot monitor file system in realtime for knowing file changes and updates, in stead, those softwares synchronize the specified files manually or by means of the daemon process. Secondly, they do not take specific requirements of enterprises into account or fulfill the synchronization of specific files, for example, the synchronization of real-time data files in host ends. Finally, those softwares cannot control the network data transmission in fine-grained way, failing to make use of bandwidth more effectively and complete different types of file synchronization rapidly.This paper follows actual business demands form a few companies, summarizes some problems exist in present remote file synchronization systems, and studies the key technology during the process of remote file synchronization, then designs and implements a kind of remote file synchronization system based on Rsync algorithm in Linux platform. The main works in this paper contain:analysising specific needs of remote file synchronization in some enterprises, proposing different types of file synchronization which including real-time data file synchronization static data file synchronization and updated file synchronization and so on. To achieve the goal of this paper, utilize Inotify API in Linux to monitor updates and changes in the specified files in realtime, then make different types of synchronization events trigger in real-time and achieve identification of these event types. Furthermore, efforts were make through making system finish appropriate treatment of different file synchronization events automatically by different identifies of different synchronization, especially the event of contents update in files which is proposed a new synchronization protocol to reduce the network bandwidth usage based on Rsync algorithm. Lastly, design different network data transmission method aiming at different synchronization tasks, in order to allow system automatically chose optional way of network data transmission via the identification of synchronization events, eventually proposes that Rsync algorithm can apply on the consistency and correctness of the file transfer.This thesis adopts hierarchy modularization methods during the process of system design and implementation, moreover, it analyzes and tests the system, concludes the research achievements and extensibility of system, puts forward the prospect of the further study at last. |