1. Field of the Invention
The present invention relates to a method, system, and program for replicating a file.
2. Description of the Related Art
File replication involves maintaining a copy (replica) of a file on a remote storage that may be updated locally. Any local updates applied to the file subject to replication are copied over (replicated) to the remote storage. For instance, the International Business Machines (“IBM”®) Tivoli® Storage Manager product provides software for a client and server systems so that the client system backs-up only a changed portion of a file on the server, either on byte level or on block level, instead of transferring the whole file to the server every time. (IBM and Tivoli are registered trademarks of IBM) The changed file portion is backed up as a differential backup relative to the last complete backup of the file (base or reference file) and it is called delta file. All changes since the last complete backup of the file are included in this delta file. In the case of a restore, software provides for the restore of the whole file by restoring only two sub-file components, one delta file and the last complete backup of the whole file, the base file.
The IBM Tivoli Storage Manager requires that the replication operations are implemented in software programs that run on both the client and the server storage receiving the delta files. Thus, proprietary agent software is implemented in both the endpoints, client and server machines, to exchange information and messages as part of the replication process.
Provided are a method, system, and program for replicating a file. A file is copied to a target storage file system stored as a base file. A reference file comprising the copied file is generated at a local storage. An update is applied to the file at the local storage. A delta file is generated indicating differences between the updated file at the local storage and the reference file. A file system command is used to transmit the delta file to the target storage file system store to store in a directory of the target storage file system, wherein the file in the local storage is replicated at the target storage by a combination of the base file and the delta file.
In an additional embodiment, a request is received to access a file in a file system in a storage device. A determination is made as to determining whether there is a delta file for the requested file providing changes to a base file in the storage device. The changes in the delta file are applied to the base file for the accessed file to produce a current version of the file in response to determining that there is a delta file. The current version of the file is generated on an output device.
In the following description, reference is made to the accompanying drawings which form a part hereof and which illustrate several embodiments of the present invention. It is understood that other embodiments may be utilized and structural and operational changes may be made without departing from the scope of the present invention.
The replication extension 10a maintains a reference file 14 comprising a copy of the base file 12 sent to the target storage 4, where the base file is stored as file 16 in a target storage file system 18. The replication extension 10a places any updates to the file 12 in a delta file 20 and transmits the delta file 20 to the target storage 4 to store in the target storage file system 18. The files 12 being replicated and their corresponding reference files 14 may be stored at a local storage 22 connected to the user system 2a, such as an attached storage device or local hard disk drives or memory. In an alternative embodiment, the target storage 4 may comprise a hard disk drive or storage unit within or directly coupled to the user system 2a from which the file 12 is being sent, so that replication occurs locally at the user system 2a on a local hard drive, such as an internal or external hard disk drive coupled directly to the user system 2a.
In certain embodiments, the replication extension 10a uses a standard file system 8a, 8b command, such as a copy or save command, to transfer the delta file 20 to the target storage file system 18. In further embodiments, the replication extension 10a may use an internal file Application Program Interface (API) command or a network transfer protocol command, such as a File Transfer Protocol (FTP) command to send a file. The delta file 20 may comprise an ordinary file in the target file system 18. The replication extension 10b may perform the operations described with respect to replication extension 10a. The replication extensions 10a, 10b further intercept requests to access files 16 in the target storage system as described below.
A file 12 replicated in the target file system 18 has a base file 16 initially sent from the user system 2a and a delta file 20. In one embodiment, the delta file 20 may have the same name as the file 16, such as the name and application type extension, plus an additional extension indicating that the file is a delta file, e.g., “x.type.delta”. In one embodiment, the delta file has a file name indicating an attribute of the delta file and base file. For instance, the attribute included in the delta file 20 file name may include a file size of the current version of the file, comprising the base file 16 combined with the differences indicated in the delta file 20. Further, the attribute included in the delta file 20 file name may comprise a code identifying the reference file 14, i.e., initial base file, to which the delta file 20 applies. The replication extension 10a, 10b uses this code to check whether the file 16 in the target file system 18 matches the reference file 14, which is the copy of the initial base file from which the delta file 20 was generated, so that the file produced by combining the base file 16 and the delta file 20 in the target file system 18 is the same updated file for which the delta file 20 was generated. In one embodiment, the code comprises a checksum value derived by applying a checksum function to the reference file 14, which is the original base file in the user system 2a, and embedding that checksum value in the name of the delta file 20. The replication extension 10a, 10b may then apply the same checksum function to the base file 16 in the target file system 18 to determine whether the base file 16 in the target storage 4 has not changed and is the same as the reference file 14 on the user system 2a, so that when the delta file 20 is applied to the base file 16 in the target file system 18 the resulting updated file is the same as the current version of the file 12 in the user system 2.
In one embodiment, the base file 16 and delta file 20 may be stored in a common directory in the target storage file system 18. For instance, they might be in the same directory or have a common higher level directory, e.g., parent directory. Further, the delta file 20 may be stored in a predetermined directory location relative to the base file 16, such as in a subdirectory of the directory including the delta file 20, a directory storing delta files 20 for different base files 16, or the same directory as the base file 16.
The users systems 2a, 2b may comprise any computing device capable of submitting requests or transactions over the network 6 to the target storage 4, including desktop computers, notebook computers, workstations, hand held computers, servers, mainframes, telephony devices, etc. The user systems 2a, 2b may also comprise host systems or servers including storage devices having files updated by other network devices. The target storage 4 may comprise a storage device or system known in the art having a file system 20, including a Redundant Array of Independent Disks (RAID), interconnected hard disk drives, a tape library, an optical library, a network attached storage (NAS), etc. The target storage 4 further includes a controller to execute requests for files in the target storage file system 20. The network 6 may comprise one or more networks known in the art, such as a Wide Area Network (WAN), Local Area Network (LAN), Storage Area Network (SAN), wireless network, the Internet, and Intranet, etc. The file system 8a, 8b may comprise the file system component of operating systems known in the art, such as Microsoft Corporation's Windows®, Linux™, Unix®, etc. (Windows is a registered trademark of Microsoft Corporation, Linux is a trademark of Linus Torvalds, and Unix is a registered trademark of The Open Group.)
In certain embodiments, each delta file 20 comprises a differential backup file including all changes that have been applied to the base file 12, stored as the reference file 14, that was copied to the base file 16 in the target storage 4. In alternative embodiments, there may be multiple incremental delta files for a file 12, where each incremental delta includes changes since the last modification to the file. In such incremental delta embodiments, multiple incremental delta files would be stored in the target storage file system 18 supplying the modifications to the base file 16 that produce the current version of the file 12.
In one embodiment, the replication extension 10a, 10b may detect changes to files 12 subject to replication and in response perform the operations at block 108 and 110. The operations at block 102 and 104 may be performed when a file 12 is initially subject to replication. Further, if the delta file 20 exceeds the base file 12 by a certain threshold, e.g., 60%, then the current version of the file 12 may be transmitted to the target storage 4 to replace the base file 16 and a new reference file 14 may be created for the current version of the file 12 so that deltas will be applied to the current version of the file 12.
With certain embodiments, the replication extension 10a, 10b may generate the current version to the user transparently. Thus, a user in a standard application, such as a word processing application, may open a dialogue box to view a list of files and will see a list that does not show any delta files 20, only the base file 16 names. If the user selects to open one of the displayed files, then the replication extension 10a, 10b would generate the current version comprising the base file 16 combined with the delta file 20. The replication extension 10a, 10b operations occur transparently to the user without requiring the user to invoke any additional applications.
Upon the file system 8a, 8b receiving (at block 168) modifications to the current version of the file to produce a modification to the file in the target storage 4, the replication extension 10a, 10b generates (at block 170) a new delta file indicating differences between the modified file and the base file 16 in the target storage file system 18. The new delta file 20 is stored (at block 172) in the target file system 18.
The described operations may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The term “article of manufacture” as used herein refers to code or logic implemented in hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.) or a computer readable medium, such as magnetic storage medium (e.g., hard disk drives, floppy disks, tape, etc.), optical storage (CD-ROMs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, firmware, programmable logic, etc.). Code in the computer readable medium is accessed and executed by a processor. The code in which preferred embodiments are implemented may further be accessible through a transmission media or from a file server over a network. In such cases, the article of manufacture in which the code is implemented may comprise a transmission media, such as a network transmission line, wireless transmission media, signals propagating through space, radio waves, infrared signals, etc. Thus, the “article of manufacture” may comprise the medium in which the code is embodied. Additionally, the “article of manufacture” may comprise a combination of hardware and software components in which the code is embodied, processed, and executed. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise any information bearing medium known in the art.
Certain operations described as performed by the replication extension may be performed by the file system.
The illustrated operations of
The foregoing description of various embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.
This application is a continuation of U.S. patent application Ser. No. 10/958,724, filed on Oct. 4, 2004, which patent application is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 10958724 | Oct 2004 | US |
Child | 12130874 | US |