CN103810056A - Method for obtaining consistent backup on Linux platform - Google Patents

Method for obtaining consistent backup on Linux platform Download PDF

Info

Publication number
CN103810056A
CN103810056A CN201210437244.7A CN201210437244A CN103810056A CN 103810056 A CN103810056 A CN 103810056A CN 201210437244 A CN201210437244 A CN 201210437244A CN 103810056 A CN103810056 A CN 103810056A
Authority
CN
China
Prior art keywords
file
backup
monitoring
function
linux
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.)
Pending
Application number
CN201210437244.7A
Other languages
Chinese (zh)
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.)
NANJING YIJIZHI INFORMATION TECHNOLOGY Co Ltd
Original Assignee
NANJING YIJIZHI INFORMATION 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 NANJING YIJIZHI INFORMATION TECHNOLOGY Co Ltd filed Critical NANJING YIJIZHI INFORMATION TECHNOLOGY Co Ltd
Priority to CN201210437244.7A priority Critical patent/CN103810056A/en
Publication of CN103810056A publication Critical patent/CN103810056A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for obtaining a consistent backup on a Linux platform. The method comprises the steps that files to be backed up are monitored, write operations of the files are intercepted in the backup process of the files, real-time data files of the files in the process of the write operations are obtained, mirror image data of the monitored files and real-time data of the monitored files are combined to form a backup according to the time sequence, and the backup generated at the moment is the consistent backup. According to the method for obtaining the consistent backup on the Linux platform, the requirement for a Linux operating system is low; due to the fact that an application module and a kernel module are used, the consistent backup of files or databases can be obtained on any Linux operating system, and the method for obtaining the consistent backup on the Linux platform is universal, and does not depend on any selectable configuration or technologies.

Description

A kind of method that obtains consistance backup on Linux platform
Technical field
The present invention relates to a kind of Computer Data Security field, particularly relate to a kind of method that obtains consistance backup on LINUX platform.
Background technology
Along with the department of computer science's widespread use of internet in every field of unifying, many government organs, company even individual more and more rely on computer data, therefore data security becomes one of important demand of information society, and data backup solves the key problem of data security just.
How what the technical program solved obtains consistance backup just on Linux platform, when user backups under some states, may there is application revising a certain file or data, Here it is makes backup time file in a state, and after having backed up, file is but in another state, and this recovering state database data hardly can be successful.
The operating system that Linux is a stable performance, powerful, efficiency is high.At present, the file backup instrument that Linux is traditional is as fairly simple in the command functions such as tar and cpio, be difficult to process the data backup of file system level, and can obtain the only snapping technique based on BTRFS, ZFS file system of consistance backup and the snapping technique of logic-based volume management (LVM).Ext3 or the ext4 file system of Linux acquiescence are not support snapshot, and logical volume management needs to install, and much Linux user may not carry out subregion and set up 1vm logical volume, therefore, for domestic consumer, this function of snapshot has very large use limitation.
Summary of the invention
The object of this invention is to provide a kind of method that obtains consistance backup on Linux platform.When user backups under some states, may have application revising a certain file or data, this just makes backup time file in a state, and after having backed up, file is but in another state, and this recovering state database data hardly can be successful.
For solving the problems of the technologies described above, the present invention takes following technical scheme:
Step 1: on Linux platform, file or the catalogue of needs monitoring are passed to administration module by application module, and send to administration module the order that starts or stop monitoring.
The monitoring module interception sys-write function of step 2:Linux kernel, is designated as OLDWRITE function by described former sys-write function, and the described sys-write function after interception is replaced with NEWWRITE function.
Step 3: in the time that user need to monitor, described application module notifies kernel to start monitoring by interface, after the write operation of file is intercepted and captured, described NEWWRITE function judges according to file handle whether described file is monitored file, if monitored file, catch operation moment, filename, start offset, the data content writing and the byte number of write operation, the real-time monitor message capturing is stored in real time data set, and last described file calls OLDWRITE function again; If not monitoring file, directly call OLDWRITE function, continue original process.
Step 4: when user program completes after the copy to monitoring file or catalogue, described application module notifies kernel to stop monitoring by interface.
Step 5: application module sets a file the mirror image data of above-mentioned monitoring file and real time data by the backup file of sequencing composition of real time data running time, and the backup now generating is exactly consistance backup.
Can find out from technique scheme, compared with the existing method that obtains consistance backup on Linux platform, the present invention has the following advantages:
The first, the present invention is lower to the requirement of (SuSE) Linux OS, by using application module and kernel module, can on any linux system, obtain the consistance backup of file or database, and method is general, do not rely on any can arrangement or technology.
The second, at present existing in Linux, must on the file system of support snapping technique or logical volume management, could obtain consistance backup.But ext3 or the ext4 file system of Linux acquiescence are not support snapshot, and logical volume management needs to install, and therefore, for domestic consumer, this function of snapshot has very large use limitation.
The 3rd, the snapshot of LVM adopts the mechanism of COW (Copy-On-Write), and, in the time that the data of former logical volume are carried out to write operation, original data block will be copied into the space of snapped volume distribution, and the flow direction of data is recorded in a table.If this logical volume exists multiple snapped volumes, original data block is the space that is copied into each snapped volume and distributes, and reduced system and write the efficiency of disk.
From the foregoing, the technology of the present invention has the advantages that operability is high, cost is low, efficiency is high.
Accompanying drawing explanation
Fig. 1 is general flow chart of the present invention.
Fig. 2 is the process flow diagram that monitoring module of the present invention is intercepted sys-write function and processed.
Fig. 3 is the process flow diagram of recording real-time data of the present invention.
Fig. 4 is the schematic diagram of synthetic consistance backup file in the present invention.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is elaborated.The present embodiment is implemented under take technical solution of the present invention as prerequisite, provided detailed embodiment and concrete operating process, but protection scope of the present invention is not limited to following embodiment.
First, user need to tell file or the catalogue that administration module need to be monitored by application module according to backup, and in the time that needs are monitored, application module sends the order that starts monitoring to administration module.In like manner, in the time not needing to monitor, application module sends the order that stops monitoring to administration module.For example, user backs up file between 11 o'clock 10, and therefore user can be chosen at 10 o'clock or before file be monitored, and when after Backup end, user can finish monitoring, also can continue as required monitoring.In addition, application module can add to administration module, delete the file that needs monitoring.
Notifying kernel module by interface when application module starts after monitoring, monitoring module interception kernel sys-write function, and sys-write function is processed, as shown in Figure 2, former sys-write function is designated as OLDWRITE function, and the described sys-write function after interception is replaced with NEWWRITE function.
As shown in Figure 3, after the write operation of file is intercepted and captured, and after the sys-write function of intercepting and capturing was carried out processing, NEWWRITE function judges according to file handle whether this file is monitored file, if not monitored file, call OLDWRITE function, the file of being intercepted and captured continues original process; If the file of being intercepted and captured is monitored file, catch the operation information of file, comprise operation moment, filename, start offset, the data content writing and byte number, the real-time monitor message capturing is stored in real time data set, last described file calls OLDWRITE function again, continues original process.Because monitor procedure is real-time, therefore can catch in real time the file that carries out write operation, every interception once forms real time data one time.Because operation information is very numerous and diverse, therefore to analyze operation information, the operation information of needs is recorded in real time data set, and real time data file is with the name of operation moment, when in chronological sequence order is synthesized consistance backup file so in the back, clear, easy operating, the consistance of assurance data.
After user completes the copy of a certain file, application module notifies kernel to stop monitoring by interface.If user need to continue monitoring to this file, described file is monitored in continuation as required, still according to the name of operation moment, while once backup, synthesizes consistance backup file at the real time data file after this forming on user carries out.
Finally, as shown in Figure 4, application module synthesizes a new backup file the mirror image data of monitoring file and real time data file set by running time der group, and the backup file of now producing is exactly consistance backup.Forming after a new consistance backup file, user can delete the image file producing and real time data file, increases Cyberspace.

Claims (3)

1. a method that obtains consistance backup on Linux platform, is characterized in that comprising the following steps:
Step 1: file or the catalogue of needs monitoring are passed to administration module by application module, and send to administration module the order that starts or stop monitoring;
The monitoring module interception sys-write function of step 2:Linux kernel, is designated as OLDWRITE by described former sys-write function, and the described sys-write function after interception is replaced with NEWWRITE function;
Step 3: described application module notifies kernel to start monitoring by interface, after the write operation of file is intercepted and captured, described NEWWRITE function judges according to file handle whether described file is monitored file, if monitored file, catch operation moment, filename, start offset, the data content writing and the byte number of write operation, the real-time monitor message capturing is stored in real time data set, last described file calls OLDWRITE function again, if not monitoring file, directly call OLDWRITE function;
Step 4: when user program completes after the copy to monitoring file or catalogue, described application module notifies kernel to stop monitoring by interface;
Step 5: application module sets a file the mirror image data of above-mentioned monitoring file and real time data by the backup file of sequencing composition of time, and the backup now generating is exactly consistance backup.
2. a kind of method that obtains consistance backup on Linux platform described in claim 1, described Linux platform is lower to the requirement of (SuSE) Linux OS, default document system, does not need to possess snapshot functions, logical volume management and other complex configurations is installed.
3. a kind of method that obtains consistance backup on Linux platform described in claim 1, described real time data set is that the real-time monitor message capturing when file carries out write operation is monitored in storage, often intercept a write operation and carry out once record, its function class is like daily record.
CN201210437244.7A 2012-11-06 2012-11-06 Method for obtaining consistent backup on Linux platform Pending CN103810056A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210437244.7A CN103810056A (en) 2012-11-06 2012-11-06 Method for obtaining consistent backup on Linux platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210437244.7A CN103810056A (en) 2012-11-06 2012-11-06 Method for obtaining consistent backup on Linux platform

Publications (1)

Publication Number Publication Date
CN103810056A true CN103810056A (en) 2014-05-21

Family

ID=50706862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210437244.7A Pending CN103810056A (en) 2012-11-06 2012-11-06 Method for obtaining consistent backup on Linux platform

Country Status (1)

Country Link
CN (1) CN103810056A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017190580A1 (en) * 2016-05-06 2017-11-09 北京奇虎科技有限公司 Method and device for accessing database
CN112000375A (en) * 2020-07-13 2020-11-27 深圳市智微智能软件开发有限公司 Starting stage judgment method, device, equipment and storage medium of android system
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux
CN117724905B (en) * 2024-02-05 2024-04-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5086502A (en) * 1989-07-11 1992-02-04 Intelligence Quotient International Limited Method of operating a data processing system
US5546534A (en) * 1993-07-19 1996-08-13 Intelligence Quotient International Ltd. Method of operating a computer system
CN1326155A (en) * 2000-05-25 2001-12-12 英业达股份有限公司 Method for instantaneous generation of file version
CN1368683A (en) * 2001-02-02 2002-09-11 英业达股份有限公司 Fault-tolerant method by means of synchronous directory
CN102467557A (en) * 2010-11-17 2012-05-23 英业达股份有限公司 Data de-duplication processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5086502A (en) * 1989-07-11 1992-02-04 Intelligence Quotient International Limited Method of operating a data processing system
US5546534A (en) * 1993-07-19 1996-08-13 Intelligence Quotient International Ltd. Method of operating a computer system
CN1326155A (en) * 2000-05-25 2001-12-12 英业达股份有限公司 Method for instantaneous generation of file version
CN1368683A (en) * 2001-02-02 2002-09-11 英业达股份有限公司 Fault-tolerant method by means of synchronous directory
CN102467557A (en) * 2010-11-17 2012-05-23 英业达股份有限公司 Data de-duplication processing method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017190580A1 (en) * 2016-05-06 2017-11-09 北京奇虎科技有限公司 Method and device for accessing database
CN112000375A (en) * 2020-07-13 2020-11-27 深圳市智微智能软件开发有限公司 Starting stage judgment method, device, equipment and storage medium of android system
CN112000375B (en) * 2020-07-13 2023-12-26 深圳市智微智能软件开发有限公司 Method, device, equipment and storage medium for judging startup stage of android system
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux
CN117724905B (en) * 2024-02-05 2024-04-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Similar Documents

Publication Publication Date Title
US10997035B2 (en) Using a snapshot as a data source
US10552373B2 (en) Space accounting for storage system snapshots
US7672979B1 (en) Backup and restore techniques using inconsistent state indicators
US8468136B2 (en) Efficient data backup
US7650475B2 (en) Storage system and method for managing data using the same
US8706694B2 (en) Continuous data protection of files stored on a remote storage device
US8805789B2 (en) Using a metadata image of a file system and archive instance to backup data objects in the file system
CN110851302B (en) Database information backup method and database information recovery method
US8732128B2 (en) Shadow copy bookmark generation
WO2020207010A1 (en) Data backup method and device, and computer-readable storage medium
US9223797B2 (en) Reparse point replication
US11914554B2 (en) Adaptable multi-layered storage for deduplicating electronic messages
CN108255638B (en) Snapshot rollback method and device
US20110276573A1 (en) Journal event consolidation
US10146637B1 (en) Intelligent snapshot rollbacks
US20200379848A1 (en) Adaptable multi-layered storage for generating search indexes
CN113886143B (en) Virtual machine continuous data protection method and device and data recovery method and device
US20110282843A1 (en) Method and system for data backup and replication
US11144233B1 (en) Efficiently managing point-in-time copies of data within a primary storage system
US20200110546A1 (en) Continuous data protection storage media using smart solid state drives
CN112800019A (en) Data backup method and system based on Hadoop distributed file system
JP2017167811A (en) Backup controller, backup controlling method, and program
CN103810056A (en) Method for obtaining consistent backup on Linux platform
CN106445729A (en) Backup virtualization-based method
WO2021208402A1 (en) Copy data management system and method for modern application

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140521