CN110471796B - File directory-oriented full and incremental backup recovery method - Google Patents

File directory-oriented full and incremental backup recovery method Download PDF

Info

Publication number
CN110471796B
CN110471796B CN201910767887.XA CN201910767887A CN110471796B CN 110471796 B CN110471796 B CN 110471796B CN 201910767887 A CN201910767887 A CN 201910767887A CN 110471796 B CN110471796 B CN 110471796B
Authority
CN
China
Prior art keywords
file
txt
directory
information
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910767887.XA
Other languages
Chinese (zh)
Other versions
CN110471796A (en
Inventor
陈琳
陈海涛
刘振东
李海卜
吴竟飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tongfang Knowledge Network Digital Publishing Technology Co ltd
Original Assignee
Tongfang Knowledge Network Digital Publishing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tongfang Knowledge Network Digital Publishing Technology Co ltd filed Critical Tongfang Knowledge Network Digital Publishing Technology Co ltd
Priority to CN201910767887.XA priority Critical patent/CN110471796B/en
Publication of CN110471796A publication Critical patent/CN110471796A/en
Application granted granted Critical
Publication of CN110471796B publication Critical patent/CN110471796B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a complete and incremental backup recovery method for file directories, which comprises the following steps: the file catalogue is completely backed up, namely the file catalogue is copied to a designated position for backup, and all files in the file catalogue are recorded; performing incremental backup on the file directory, generating a new file directory record in the incremental backup process, comparing the new file directory record with the old file directory record, storing the newly added, modified and deleted file information, and replacing the old file directory with the new file directory; copying and replacing the original file directory by the file directory data of the previous complete backup; and deleting the files to be deleted according to the deleted file information of the incremental backup data record, and copying and replacing the stored newly added and modified files to the original files.

Description

File directory-oriented full and incremental backup recovery method
Technical Field
The invention relates to a backup and recovery method facing to a file directory, in particular to a complete and incremental backup and recovery method facing to the file directory.
Background
File directories are a widely used data storage mode, and sometimes a lot of important data is stored in the file directories, so that as the data is more and more, the demands for backup and recovery of the file directories are more and more urgent. If the file catalogue is directly copied and backed up, a large amount of storage resources are occupied, the waste of the storage resources is caused, and the file catalogue is reasonably backed up in a fully incremental backup mode.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a method for complete and incremental backup and recovery of a file directory, and the final aim of the method is to backup and recover file directory data.
The aim of the invention is achieved by the following technical scheme:
a method of full and incremental backup and restore to a file directory, comprising:
a, carrying out complete backup on the file catalogue, namely copying the file catalogue to a designated position for backup, and recording all files in the file catalogue;
b, performing incremental backup on the file catalogue, generating a new file catalogue record in the incremental backup process, comparing the new file catalogue record with the old file catalogue record, storing the newly added, modified and deleted file information, and replacing the old file catalogue with the new file catalogue;
copying the file directory data of the previous complete backup to replace the original file directory;
and D, deleting the files to be deleted according to the deleted file information recorded by the incremental backup data, and copying and replacing the stored newly added and modified files to the original files.
One or more embodiments of the present invention may have the following advantages over the prior art:
the invention only stores the newly added, modified and deleted file information during incremental backup by utilizing the simple file directory record (file path and MD5 value), thereby avoiding occupying a large amount of storage resources.
Drawings
FIG. 1 is a flow chart of a method of full and incremental backup and restore for a file directory;
FIG. 2 is a full back-up schematic;
FIG. 3 is a schematic diagram of a first embodiment incremental backup;
FIG. 4 is a schematic diagram of a second embodiment incremental backup;
FIG. 5 is a full recovery schematic;
fig. 6 is an incremental recovery schematic.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the following examples and the accompanying drawings.
As shown in fig. 1, the method flow for complete and incremental backup and recovery of file directory comprises the following steps:
step 10, carrying out complete backup on the file catalogue, namely copying the file catalogue to a designated position for backup, and recording all files in the file catalogue;
step 20, performing incremental backup on the file catalogue, generating a new file catalogue record in the incremental backup process, comparing the new file catalogue record with the old file catalogue record, storing the newly added, modified and deleted file information, and replacing the old file catalogue with the new file catalogue;
step 30, copying the file directory data of the previous complete backup to replace the original file directory;
and step 40, deleting the files to be deleted according to the deleted file information recorded by the incremental backup data, and copying the stored newly added and modified files to replace the original files.
Step 10 is a full backup, copying the file directory to a designated location, and generating a file directory record in the original file directory, namely: oldAbllLog. Txt file (key is file path, value is MD5 value), as shown in FIG. 2, is a full backup schematic.
The step 20 is incremental backup, and specifically includes: generating a new file directory record according to the file path in the file directory and the MD5 value generated by using the file information, and comparing the new file directory record with the old file directory record: if the MD5 values of the same file path are different, indicating that the file is modified, and recording modified file information (file path and file); if there is a file path in the new file directory record and there is no file path in the old file directory, the file is a newly added file, and the information (file path and file) of the newly added file is recorded; if there is no file path in the new file directory record, but there is a file path in the old file directory, the file is a deleted file, and deleted file information (file path) is recorded.
The first embodiment is as follows:
generating a new record newLog. Txt (key is a file path and value is an MD5 value) file for the file directory;
judging whether the oldAddLog.txt file exists,
if the file information does not exist, comparing the newLog. Txt with the oldAbllLog. Txt, recording the newly added and modified file information, and generating delLog. Txt in the incremental backup file for recording the deleted file information. And renaming the newLog.txt file to oldAddLog.txt, and storing the newLog.txt file in the original file directory. FIG. 3 is a schematic diagram of a first embodiment incremental backup.
The second embodiment is as follows:
if so, the dates of oldAddLog. Txt and oldAllLog. Txt are determined.
If the oldAddLog.txt time is earlier than the oldAllLog.txt time, comparing the newLog.txt with the oldAllLog.txt, recording newly added, modified and deleted file information, renaming the newLog.txt file to oldAddLog.txt, replacing the original oldAddLog.txt, and storing the new log information and the old oldAddLog.txt in the original file directory.
If the oldAddLog.txt time is later than the oldAllLog.txt time, comparing the newLog.txt with the oldAddLog.txt, and recording newly added, modified and deleted file information. And renaming the newLog.txt file to oldAddLog.txt, replacing the original oldAddLog.txt, and storing the file in the original file directory. FIG. 4 is a schematic diagram of a second embodiment incremental backup.
Step 30 is complete restoration, i.e. the original file directory is replaced by copying the previously stored complete backup data. A full recovery schematic is shown in fig. 5.
The step 40 is incremental recovery, and specifically includes: acquiring file information stored in the incremental backup data, and deleting files to be deleted according to the file deleting information (file path) recorded by the incremental backup data; copying and replacing the saved file according to the modified file information (file and file path); and copying the saved newly added file to the designated file path according to the newly added file information (file and file path). An incremental recovery schematic is shown in fig. 6.
Although the embodiments of the present invention are described above, the embodiments are only used for facilitating understanding of the present invention, and are not intended to limit the present invention. Any person skilled in the art can make any modification and variation in form and detail without departing from the spirit and scope of the present disclosure, but the scope of the present disclosure is still subject to the scope of the appended claims.

Claims (3)

1. A method for full and incremental backup restoration for a file directory, the method comprising:
a, carrying out complete backup on the file catalogue, namely copying the file catalogue to a designated position for backup, and recording all files in the file catalogue;
b, performing incremental backup on the file catalogue, generating a new file catalogue record in the incremental backup process, comparing the new file catalogue record with the old file catalogue record, storing the newly added, modified and deleted file information, and replacing the old file catalogue with the new file catalogue;
copying the file directory data of the previous complete backup to replace the original file directory;
d, deleting the files to be deleted according to the deleted file information recorded by the incremental backup data, and copying and replacing the stored newly added and modified files to the original files;
the step A specifically comprises the following steps: generating a file directory record according to a file path in the file directory and an MD5 value generated by utilizing the file information;
the step B specifically comprises the following steps: generating a new file directory record according to the file path in the file directory and the MD5 value generated by using the file information, and comparing the new file directory record with the old file directory record: if the MD5 values of the same file path are different, indicating that the file is modified, and recording the modified file information; if the new file directory record has a file path and the old file directory has no file path, the file is a newly added file, and the information of the newly added file is recorded; if the new file directory record has no file path but the old file directory has a file path, the file is a deleted file, and the deleted file information is recorded;
generating a new record newLog.txt file for the file directory;
judging whether the oldAddLog.txt file exists or not;
if the file information does not exist, comparing the newLog. Txt with the oldAbllLog. Txt, recording the newly added and modified file information, and generating delLog. Txt in the incremental backup file for recording the deleted file information; the newLog.txt file is renamed as oldAddLog.txt and stored in the original file catalog;
if so, judging the dates of the oldAddLog. Txt and the oldAllLog. Txt;
if the oldAddLog.txt time is earlier than the oldAllLog.txt time, comparing the newLog.txt with the oldAllLog.txt, recording newly added, modified and deleted file information, renaming the newLog.txt file to oldAddLog.txt, replacing the original oldAddLog.txt, and storing the new log information and the old oldAddLog.txt in an original file directory;
if the oldAddLog.txt time is later than the oldAllLog.txt time, comparing the newLog.txt with the oldAddLog.txt, and recording newly added, modified and deleted file information; and renaming the newLog.txt file to oldAddLog.txt, replacing the original oldAddLog.txt, and storing the file in the original file directory.
2. The method for restoring full and incremental backup to a file directory according to claim 1 wherein said step C comprises: restoring the completely backed up file directory data, and copying and replacing the completely backed up file directory data to the original file directory.
3. The method for restoring full and incremental backup to a file directory according to claim 1 wherein step D comprises: deleting the files to be deleted according to the deleted file information of the incremental backup data record; copying and replacing the saved file according to the modified file information to replace the file under the appointed path; and copying the stored newly-added file to a designated file path according to the newly-added file information.
CN201910767887.XA 2019-08-20 2019-08-20 File directory-oriented full and incremental backup recovery method Active CN110471796B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910767887.XA CN110471796B (en) 2019-08-20 2019-08-20 File directory-oriented full and incremental backup recovery method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910767887.XA CN110471796B (en) 2019-08-20 2019-08-20 File directory-oriented full and incremental backup recovery method

Publications (2)

Publication Number Publication Date
CN110471796A CN110471796A (en) 2019-11-19
CN110471796B true CN110471796B (en) 2024-01-23

Family

ID=68511974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910767887.XA Active CN110471796B (en) 2019-08-20 2019-08-20 File directory-oriented full and incremental backup recovery method

Country Status (1)

Country Link
CN (1) CN110471796B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327292B (en) * 2021-12-31 2024-02-02 上海移为通信技术股份有限公司 File management method, system, electronic device and storage medium
CN114995913A (en) * 2022-06-10 2022-09-02 北京宇信科技集团股份有限公司 Method, device, medium and equipment for reading rule running file by decision engine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051285A (en) * 2006-09-21 2007-10-10 上海交通大学 File matching method in computer network data backup
US7797279B1 (en) * 2007-12-31 2010-09-14 Emc Corporation Merging of incremental data streams with prior backed-up data
CN104714859A (en) * 2013-12-17 2015-06-17 南京壹进制信息技术有限公司 Rapid backup and recovery method of mass files
CN109522160A (en) * 2018-11-29 2019-03-26 上海英方软件股份有限公司 Compare backup method and system by saving the file information abstract progress file directory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051285A (en) * 2006-09-21 2007-10-10 上海交通大学 File matching method in computer network data backup
US7797279B1 (en) * 2007-12-31 2010-09-14 Emc Corporation Merging of incremental data streams with prior backed-up data
CN104714859A (en) * 2013-12-17 2015-06-17 南京壹进制信息技术有限公司 Rapid backup and recovery method of mass files
CN109522160A (en) * 2018-11-29 2019-03-26 上海英方软件股份有限公司 Compare backup method and system by saving the file information abstract progress file directory

Also Published As

Publication number Publication date
CN110471796A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
US20230350761A1 (en) Restoring a database using a fully hydrated backup
US9645892B1 (en) Recording file events in change logs while incrementally backing up file systems
US7310654B2 (en) Method and system for providing image incremental and disaster recovery
US8370311B2 (en) Using versioning to back up multiple versions of a stored object
US10204016B1 (en) Incrementally backing up file system hard links based on change logs
KR101556435B1 (en) Database backing-up and recovering method and device
EP3796174B1 (en) Restoring a database using a fully hydrated backup
US7801867B2 (en) Optimizing backup and recovery utilizing change tracking
US20080162599A1 (en) Optimizing backup and recovery utilizing change tracking
CN102023903B (en) Version management method and device for data backup
WO1998035285A2 (en) Database/template driven file selection for backup programs
CN112286728A (en) Data backup method, device, equipment and computer storage medium
CN110471796B (en) File directory-oriented full and incremental backup recovery method
US9916324B2 (en) Updating key value databases for virtual backups
US7739464B1 (en) Consistent backups of data using a roll-back log
CN112800019A (en) Data backup method and system based on Hadoop distributed file system
CN109753381B (en) Continuous data protection method based on object storage
US20030101167A1 (en) File maintenance on a computer grid
US20160026536A1 (en) Recovery path selection during database restore
US8595271B1 (en) Systems and methods for performing file system checks
WO2017067397A1 (en) Data recovery method and device
JP3985430B2 (en) Database management apparatus and method
US8782006B1 (en) Method and apparatus for file sharing between continuous and scheduled backups
US7472141B1 (en) System and method for controlling off-host policies
CN108089942B (en) Data backup and recovery method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230725

Address after: Rooms B201, B202, B203, B205, B206, B207, B208, B209, B210, 2nd Floor, Building B-2, Zhongguancun Dongsheng Science and Technology Park, No. 66 Xixiaokou Road, Haidian District, Beijing, 100084 (Dongsheng District)

Applicant after: TONGFANG KNOWLEDGE NETWORK DIGITAL PUBLISHING TECHNOLOGY CO.,LTD.

Address before: 100084 Beijing city Haidian District Tsinghua University Tsinghua Yuan 36 zone B1410, Huaye building 1412, room 1414

Applicant before: TONGFANG KNOWLEDGE NETWORK (BEIJING) TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant