CN111475470A - Method and system for recovering deleted files and directories of recycle bin - Google Patents

Method and system for recovering deleted files and directories of recycle bin Download PDF

Info

Publication number
CN111475470A
CN111475470A CN202010231200.3A CN202010231200A CN111475470A CN 111475470 A CN111475470 A CN 111475470A CN 202010231200 A CN202010231200 A CN 202010231200A CN 111475470 A CN111475470 A CN 111475470A
Authority
CN
China
Prior art keywords
time
recycle
parameter
directories
recycle bin
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.)
Granted
Application number
CN202010231200.3A
Other languages
Chinese (zh)
Other versions
CN111475470B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010231200.3A priority Critical patent/CN111475470B/en
Publication of CN111475470A publication Critical patent/CN111475470A/en
Application granted granted Critical
Publication of CN111475470B publication Critical patent/CN111475470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/11File system administration, e.g. details of archiving or snapshots
    • 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/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • 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/18File system types
    • G06F16/182Distributed file systems

Landscapes

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

Abstract

The invention provides a method and a system for recovering deleted files and directories of a recycle bin, which both comprise the following steps: starting a recycle bin service; adding and configuring parameters of update and recycle _ time in a recycle bin configuration file of a main node; synchronizing the recycle bin configuration file to other nodes; when the time interval corresponding to the parameter value of the update parameter is reached every time, emptying the files and directories in the recycle bin of each node, and in the emptying process, unloading the emptied files and directories, recording the names of the emptied files and directories and the emptied time; after receiving a recovery instruction, screening out a corresponding file name or directory name from the record; screening out the corresponding directory from the transferred files and directories, and recovering to a preset file system directory; and under the condition of inquiring the directory of the file system, if the file and/or the directory corresponding to the name of the target object exists, the recovery is successful. The invention is used for recovering the deleted files and directories in the recycle bin.

Description

Method and system for recovering deleted files and directories of recycle bin
Technical Field
The invention relates to the field of recycle bins, in particular to a method and a system for recovering deleted files and directories of a recycle bin.
Background
The distributed file storage system is widely applied to the fields of IT enterprises, cloud computing, big data, virtualization and the like. Meanwhile, the requirements of the fields on the file directory recycle bin function of the storage system are higher and higher, only the recycle bin function is provided for users to empty files and directories, the use of the storage system cannot be met, and the users can recover the files according to the use requirements after the recycle bin is emptied.
However, the existing distributed file system cannot restore the files and the directories in the recycle bin after the files and the directories are deleted, so that the robustness, the usability and the function richness of the storage system are reduced, and the competitiveness of a distributed file storage product is seriously influenced.
Therefore, the invention provides a method and a system for recovering deleted files and directories of a recycle bin, which are used for solving the problems.
Disclosure of Invention
In view of the above disadvantages in the prior art, the present invention provides a method and a system for recovering deleted files and directories in a recycle bin, which are used to recover the deleted files and directories in the recycle bin.
In a first aspect, the present invention provides a method for recovering deleted files and directories in a recycle bin, where the method is applied to a distributed file storage system, and includes the steps of:
starting a recycle bin service of each node of the distributed file storage system;
adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of a distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying of recycle bins, and the parameter value of the recycle _ time parameter represents recycle bin time of the master node when the recycle _ time parameter is added;
synchronizing the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
when the time interval corresponding to the parameter value of the update parameter is reached every time, emptying the files and the directories in the node recycle bin once respectively, unloading the emptied files and directories in the emptying process, recording the names and the emptying time of the emptied files, and recording the names and the emptying time of the emptied directories;
after receiving an instruction for recovering the target object, screening out a file name and a directory name with the same time of being emptied from the recorded names of the emptied files and directories according to the time of the target object being emptied from the recycle bin;
screening out files corresponding to the file names and directories corresponding to the directory names from the dumped emptied files and directories, and recovering the files and the directories to preset file system directories;
and inquiring whether files and/or directories corresponding to the names of the target objects exist under the directory of the file system: if yes, the recovery is successful.
Further, after synchronizing the recycle bin configuration file with the added update parameter and recycle _ time parameter to other nodes of the distributed file storage system for recycle bin time alignment, the method further comprises the following steps:
and checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration files of all the nodes of the distributed file storage system through a command, outputting TRUE and continuing to execute the program and continuing to execute the next step if the check result is yes, closing the recycle bin service of the distributed file storage system and outputting FA L SE and exiting the program if the check result is not yes.
Further, a dynamic parameter is added to the recycle bin configuration file of the main node of the distributed file storage system, wherein when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through a command is yes, the dynamic parameter is TRUE, and when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through the command is no, the dynamic parameter is FA L SE.
Further, the name and the time of clearing of each cleared file, and the name and the time of clearing of each cleared directory are recorded in the same database.
Further, screening out the file name and the directory name with the same emptying time from the recorded names of the emptied files and directories according to the emptying time of the target object from the recycle bin, and the method comprises the following steps:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
In a second aspect, the present invention further provides a system for recovering deleted files and directories in a recycle bin, where the system is applied to a distributed file storage system, and the system includes:
the starting unit is used for starting the recycle bin service of each node of the distributed file storage system;
the configuration unit is used for adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of the distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as the system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying the recycle bin, and the parameter value of the recycle _ time parameter represents the recycle bin time of the master node when the recycle _ time parameter is added;
the synchronization unit synchronizes the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
the recycle bin emptying unit is used for emptying the files and the directories in the recycle bins of each node once when the time interval corresponding to the parameter value of the update parameter is reached every time, unloading the emptied files and directories in the emptying process, recording the names and the emptied time of the emptied files, and recording the names and the emptied time of the emptied directories;
the screening unit screens out file names and directory names with the same cleared time from the recorded cleared file and directory names according to the cleared time of the target object from the recycle bin after receiving the command of restoring the target object;
the recovery unit screens out the files corresponding to the file names and the directories corresponding to the directory names from the dumped emptied files and directories, and recovers the files and the directories to a preset file system directory;
and the recovery result query unit is used for querying whether the file and/or the directory corresponding to the name of the target object exists in the directory of the file system, and outputting the recovery success when the query result is yes.
Further, the system further comprises:
and the recovery mechanism checking unit is used for checking whether the recycle bin configuration files of all the nodes of the distributed file storage system are configured with the update parameter and the recycle _ time parameter through commands after the synchronization unit synchronizes the recycle bin configuration files added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system, outputting TRUE and continuing to execute the program if the checking result is yes, closing the recycle bin service of the distributed file storage system, outputting FA L SEE and terminating the program if the checking result is not.
Further, the recovery mechanism checking unit adds a dynamic parameter in a recycle bin configuration file of a master node of the distributed file storage system in advance, wherein when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through a command, the dynamic parameter is TRUE, and when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through the command, the dynamic parameter is FA L SE.
Further, the name and the time of clearing of each cleared file, and the name and the time of clearing of each cleared directory are recorded in the same database.
Further, the screening unit screens out the file name and the directory name having the same cleared time from the recorded names of the cleared files and directories according to the cleared time of the target object from the recycle bin, and the specific implementation method includes:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
The beneficial effect of the invention is that,
the method and the system for restoring the recycle bin to delete the files and the directories provided by the invention can empty the files and the directories in the recycle bin of the distributed file system once based on the time length set by the update parameter at intervals, thereby being beneficial to improving the operation performance of each node of the distributed file system to a certain extent, and can screen out the file names and the directory names with the same emptied time from the recorded names of the emptied files and directories according to the time for the target object to be emptied from the recycle bin after receiving the instruction for restoring the target object.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
As shown in fig. 1, the method 100 is applied to a distributed file storage system, and includes:
step 110, starting recycle bin services of each node of the distributed file storage system;
step 120, adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of the distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as the system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying the recycle bin, and the parameter value of the recycle _ time parameter represents the recycle bin time of the master node when the recycle _ time parameter is added;
step 130, synchronizing the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
step 140, when the time interval corresponding to the parameter value of the update parameter is reached each time, emptying the files and directories in the node recycle bin once respectively, and in the emptying process, unloading the emptied files and directories, recording the names and the emptied times of the emptied files, and recording the names and the emptied times of the emptied directories;
step 150, after receiving the instruction for recovering the target object, screening out the file name and the directory name with the same time of being emptied from the recorded names of the emptied files and directories according to the time of the target object being emptied from the recycle bin;
step 160, screening out the files corresponding to the file names and the directories corresponding to the directory names from the dumped emptied files and directories, and restoring the files and the directories to the preset file system directories;
step 170, inquiring whether the file and/or directory corresponding to the name of the target object exists in the file system directory: if yes, the recovery is successful.
If the query result is no in step 170, the recovery fails.
Optionally, between step 130 and step 140, the method further comprises the steps of:
and checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration files of all the nodes of the distributed file storage system through a command, outputting TRUE and continuing to execute the program and continuing to execute the next step if the check result is yes, closing the recycle bin service of the distributed file storage system and outputting FA L SE and exiting the program if the check result is not yes.
Specifically, a dynamic parameter is added in a recycle bin configuration file of a master node of the distributed file storage system, wherein when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through a command, the dynamic parameter is TRUE, and when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system is checked through the command, the dynamic parameter is FA L SE.
Optionally, the name and time of each emptied file, and the name and time of each emptied directory are recorded in the same database.
Optionally, screening out the file name and the directory name having the same emptying time from the recorded names of the emptied files and directories according to the emptying time of the target object from the recycle bin, including:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
In order to facilitate understanding of the present invention, the method for recovering files and directories deleted from a recycle bin provided by the present invention is further described below with reference to the principle of the method for recovering files and directories deleted from a recycle bin of a distributed file storage system in combination with the process of recovering the deleted files and directories from the recycle bin in the embodiment.
Specifically, the method for recovering the recycle bin to delete the files and the directories comprises the following steps:
step S1: and starting the recycle bin service of each node of the distributed file storage system.
And starting a recycle bin service of each node of the distributed file storage system by commanding the icfs-admin-recycle-start.
Step S2: adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of a distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying of recycle bins, and the parameter value of the recycle _ time parameter represents recycle bin time of the master node when the recycle _ time parameter is added.
In the recycle _ conf configuration file (i.e. recycle bin configuration file) under the host node/usr/bin directory of the distributed file storage system, the update and recycle _ time parameters are newly added, and the system time system _ disk _ time of the host node is aligned with the recycle bin time recycle _ time of the recycle bin.
In this embodiment, update is 6000 ms.
Step S3: and synchronizing the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time.
In this embodiment, after synchronizing the recycle bin configuration file to which the update parameter and recycle _ time parameter are added to other nodes of the distributed file storage system for aligning the recycle bin time:
and checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration files of all the nodes of the distributed file storage system through a command, outputting TRUE and continuing to execute the program and continuing to execute the next step if the check result is yes, closing the recycle bin service of the distributed file storage system and outputting FA L SE and exiting the program if the check result is not yes.
In the specific implementation, a dynamic parameter can be added in the recycle bin configuration file of the main node of the distributed file storage system in advance, wherein when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system through the command is yes, the dynamic parameter is TRUE, and when the check result that whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system through the command is no, the dynamic parameter is FA L SE.
Step S4: and when the time interval corresponding to the parameter value of the update parameter is reached every time, emptying the files and the directories in the node recycle bin once respectively, unloading the emptied files and directories in the emptying process, recording the names and the emptying time of the emptied files, and recording the names and the emptying time of the emptied directories.
In this embodiment, according to a parameter value of an update parameter, files and directories in a recycle bin of each node of the distributed file storage system are completely deleted every 6000ms, and names of the files and directories that are emptied (i.e., deleted) in the recycle bin and an emptied time system _ disk _ time (the time is system time) are recorded, for example, when a file a and a directory B are deleted from the recycle bin in a node of the distributed file storage system, the name of the file a, the name of the directory B, the emptied time system _ disk _ time of the file a, the emptied time system _ disk _ time of the directory B, the name of the file a, the name of the directory B, the emptied time system _ disk _ time of the file a, and the emptied time system _ disk _ time of the directory B are recorded in the same SQ L database.
In this embodiment, the emptied files and directories in each node of the distributed file storage system are transferred to another SQ L database.
Step S5: and after receiving an instruction for recovering the target object, screening out the file name and the directory name with the same time of emptying from the recorded names of the emptied file and directory according to the time of emptying the target object from the recycle bin.
In this embodiment, the target object is a file a.
In this embodiment, the step S5 of screening out the file name and the directory name having the same time of being emptied from the recorded names of the emptied files and directories according to the time of the target object being emptied from the recycle bin includes the steps of:
reading the names and the emptying time of all emptied files and directories from the recycle bin of the distributed file storage system recorded in the SQ L database, and storing the names and the emptying time in a delete _ list;
the file name and directory name having the same cleared time as file a (target object) are screened out in the delete _ list.
For example, the system _ disk _ time when the file a is cleared is time 1, and the delete _ list is screened for the file name and the directory name that have the same cleared time as the file a, that is, the system _ disk _ time (cleared time) in the delete _ list is screened for the file name and the directory name that are the same as the time 1.
Other target objects may be referenced for execution. It should be noted that a plurality of target objects may be used, and the above embodiment may be specifically referred to.
Step S6: and screening out the files corresponding to the file names and the directories corresponding to the directory names from the dumped emptied files and directories, and recovering the files and the directories to the preset file system directories.
In this embodiment, in the step S6, in a specific implementation, a destination parameter is added to the recycle _ conf in advance, and according to the destination parameter value (which is a file system directory), the file corresponding to the file NAME (FI L E _ NAME) screened in the step S5 and the directory corresponding to the screened directory NAME (DIR _ NAME) are restored to the file system directory configured by the destination.
Step S7: and inquiring whether files and/or directories corresponding to the names of the target objects exist under the directory of the file system: if yes, the recovery is successful; if not, the recovery fails.
And inquiring whether files and directories of FI L E _ NAME and DIR _ NAME exist in the destination directory, if so, returning 0 (indicating that the recovery is successful) by the program, and otherwise, returning 1 (indicating that the recovery is failed) by the program.
It can be seen that the method can empty the files and directories in the recycle bin of the distributed file system once every time length set by the update parameter, thereby contributing to improving the operation performance of each node of the distributed file system, and can screen out the file names and directory names with the same empty time from the names of the recorded empty files and directories according to the time for the target object to be emptied from the recycle bin to carry out the restoration of the target object after receiving the instruction for restoring the target object.
Example 2:
FIG. 2 is a schematic flow diagram of a system of one embodiment of the invention.
As shown in fig. 2, the system 200 is applied to a distributed file storage system, including:
a starting unit 201, which starts a recycle bin service of each node of the distributed file storage system;
a configuration unit 202, configured to add an update parameter and a recycle _ time parameter to a recycle bin configuration file of a master node of a distributed file storage system, set a parameter value of the update parameter, and set a value of the recycle _ time parameter as a system time of the master node at a corresponding time point, where the parameter value of the update parameter is a time interval between two adjacent times of emptying of a recycle bin, and the parameter value of the recycle _ time parameter indicates a recycle bin time of the master node when the recycle _ time parameter is added;
the synchronization unit 203 synchronizes the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
the recycle bin emptying unit 204 is used for emptying the files and directories in the recycle bins of each node once when the time interval corresponding to the parameter value of the update parameter is reached every time, unloading the emptied files and directories in the emptying process, recording the names and the emptied time of the emptied files, and recording the names and the emptied time of the emptied directories;
a screening unit 205, after receiving the instruction to restore the target object, screening out a file name and a directory name having the same time to be emptied from the recorded names of the emptied files and directories according to the time to empty the target object from the recycle bin;
a recovery unit 206, which screens out the files corresponding to the file names and the directories corresponding to the directory names from the dumped emptied files and directories, and recovers the files and the directories to a preset file system directory;
the recovery result query unit 207 queries whether a file and/or directory corresponding to the name of the target object exists in the file system directory, and outputs a recovery success if the query result is yes.
The recovery failure is output when the query result of the recovery result querying unit 207 is no.
Optionally, the system further comprises:
the recovery mechanism checking unit 208 synchronizes the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system for aligning recycle bin time by the synchronization unit 203, checks whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system through a command, outputs TRUE if the check result is yes, closes the recycle bin service of the distributed file storage system if the check result is no, outputs FA L SEE, and terminates the program.
Further, the recovery mechanism checking unit 208 adds a dynamic parameter to the recycle bin configuration file of the master node of the distributed file storage system in advance, where if the check result that whether the update parameter and the recycle _ time parameter are both configured in the recycle bin configuration file of each node of the distributed file storage system is checked by the command, the dynamic parameter is TRUE, and if the check result that whether the update parameter and the recycle _ time parameter are both configured in the recycle bin configuration file of each node of the distributed file storage system is checked by the command, the dynamic parameter is FA L SE.
Optionally, the name and time of each emptied file, and the name and time of each emptied directory are recorded in the same database.
Optionally, the screening unit 205 screens out, from the recorded names of the emptied files and directories according to the time when the target object is emptied from the recycle bin, the file name and the directory name having the same emptied time, and the specific implementation method includes:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the description in the method embodiment.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for recovering deleted files and directories of a recycle bin is applied to a distributed file storage system and comprises the following steps:
starting a recycle bin service of each node of the distributed file storage system;
adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of a distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying of recycle bins, and the parameter value of the recycle _ time parameter represents recycle bin time of the master node when the recycle _ time parameter is added;
synchronizing the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
when the time interval corresponding to the parameter value of the update parameter is reached every time, emptying the files and the directories in the node recycle bin once respectively, unloading the emptied files and directories in the emptying process, recording the names and the emptying time of the emptied files, and recording the names and the emptying time of the emptied directories;
after receiving an instruction for recovering the target object, screening out a file name and a directory name with the same time of being emptied from the recorded names of the emptied files and directories according to the time of the target object being emptied from the recycle bin;
screening out files corresponding to the file names and directories corresponding to the directory names from the dumped emptied files and directories, and recovering the files and the directories to preset file system directories;
and inquiring whether files and/or directories corresponding to the names of the target objects exist under the directory of the file system: if yes, the recovery is successful.
2. The method for recovering the recycle bin deleted files and directories as claimed in claim 1, wherein the step of synchronizing the recycle bin configuration file with the added update parameter and recycle _ time parameter to other nodes of the distributed file storage system for the recycle bin time alignment further comprises the steps of:
and checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration files of all the nodes of the distributed file storage system through a command, outputting TRUE and continuing to execute the program and continuing to execute the next step if the check result is yes, closing the recycle bin service of the distributed file storage system and outputting FA L SE and exiting the program if the check result is not yes.
3. The method for recovering the recycle bin deleted files and directories as claimed in claim 2, further comprising adding a dynamic parameter, wherein if the check result of checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system by the command is yes, the dynamic parameter is TRUE, and if the check result of checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system by the command is no, the dynamic parameter is FA L.
4. The method for recovering the deleted files and directories at the recycle bin as claimed in claim 1, wherein the name and the emptied time of each emptied file and the name and the emptied time of each emptied directory are recorded in the same database.
5. The method for recovering the deleted files and directories in the recycle bin as claimed in claim 4, further comprising the step of screening the names of the files and directories with the same emptying time from the recorded names of the emptied files and directories according to the emptying time of the target object from the recycle bin, comprising:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
6. A system for recovering deleted files and directories at a recycle bin, the system being applied to a distributed file storage system, comprising:
the starting unit is used for starting the recycle bin service of each node of the distributed file storage system;
the configuration unit is used for adding an update parameter and a recycle _ time parameter in a recycle bin configuration file of a master node of the distributed file storage system, setting a parameter value of the update parameter and setting a value of the recycle _ time parameter as the system time of the master node at a corresponding time point, wherein the parameter value of the update parameter is a time interval between two adjacent times of emptying the recycle bin, and the parameter value of the recycle _ time parameter represents the recycle bin time of the master node when the recycle _ time parameter is added;
the synchronization unit synchronizes the recycle bin configuration file added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system to align the recycle bin time;
the recycle bin emptying unit is used for emptying the files and the directories in the recycle bins of each node once when the time interval corresponding to the parameter value of the update parameter is reached every time, unloading the emptied files and directories in the emptying process, recording the names and the emptied time of the emptied files, and recording the names and the emptied time of the emptied directories;
the screening unit screens out file names and directory names with the same cleared time from the recorded cleared file and directory names according to the cleared time of the target object from the recycle bin after receiving the command of restoring the target object;
the recovery unit screens out the files corresponding to the file names and the directories corresponding to the directory names from the dumped emptied files and directories, and recovers the files and the directories to a preset file system directory;
and the recovery result query unit is used for querying whether the file and/or the directory corresponding to the name of the target object exists in the directory of the file system, and outputting the recovery success when the query result is yes.
7. The system for recovering recycle bin deleted files and directories as claimed in claim 6, further comprising:
and the recovery mechanism checking unit is used for checking whether the recycle bin configuration files of all the nodes of the distributed file storage system are configured with the update parameter and the recycle _ time parameter through commands after the synchronization unit synchronizes the recycle bin configuration files added with the update parameter and the recycle _ time parameter to other nodes of the distributed file storage system, outputting TRUE and continuing to execute the program if the checking result is yes, closing the recycle bin service of the distributed file storage system, outputting FA L SEE and terminating the program if the checking result is not.
8. The system for recovering the delete file and directory of the recycle bin as claimed in claim 7, further characterized in that the recovery mechanism checking unit adds a dynamic parameter in the recycle bin configuration file of the master node of the distributed file storage system in advance, wherein if the check result of checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system by the command is yes, the dynamic FA L SE is determined if the check result of checking whether the update parameter and the recycle _ time parameter are configured in the recycle bin configuration file of each node of the distributed file storage system by the command is no.
9. The system for recovering a recycle bin deleted file and directory as claimed in claim 6, wherein the name and the time of emptying of each emptied file and the name and the time of emptying of each emptied directory are recorded in the same database.
10. The system for recovering the deleted files and directories in the recycle bin according to claim 9, further comprising a screening unit for screening out the file name and the directory name with the same emptying time from the recorded names of the emptied files and directories according to the emptying time of the target object from the recycle bin, wherein the specific implementation method comprises:
reading the names and the emptying time of each emptied file and directory recorded in the database, and storing the names and the emptying time in a delete _ list;
the file name and directory name that have the same cleared time as the target object are screened out in the delete _ list.
CN202010231200.3A 2020-03-27 2020-03-27 Method and system for recovering deleted files and directories of recycle bin Active CN111475470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010231200.3A CN111475470B (en) 2020-03-27 2020-03-27 Method and system for recovering deleted files and directories of recycle bin

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010231200.3A CN111475470B (en) 2020-03-27 2020-03-27 Method and system for recovering deleted files and directories of recycle bin

Publications (2)

Publication Number Publication Date
CN111475470A true CN111475470A (en) 2020-07-31
CN111475470B CN111475470B (en) 2022-05-31

Family

ID=71747891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010231200.3A Active CN111475470B (en) 2020-03-27 2020-03-27 Method and system for recovering deleted files and directories of recycle bin

Country Status (1)

Country Link
CN (1) CN111475470B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342579A (en) * 2021-07-05 2021-09-03 湖南快乐阳光互动娱乐传媒有限公司 Data restoration method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Recycle bin application process and system on a kind of distributed type assemblies
CN108197270A (en) * 2018-01-04 2018-06-22 中科边缘智慧信息科技(苏州)有限公司 distributed file system data recovery method
CN110069457A (en) * 2019-04-24 2019-07-30 苏州浪潮智能科技有限公司 One kind is based on scratch file delet method and system in distributed file storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Recycle bin application process and system on a kind of distributed type assemblies
CN108197270A (en) * 2018-01-04 2018-06-22 中科边缘智慧信息科技(苏州)有限公司 distributed file system data recovery method
CN110069457A (en) * 2019-04-24 2019-07-30 苏州浪潮智能科技有限公司 One kind is based on scratch file delet method and system in distributed file storage system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342579A (en) * 2021-07-05 2021-09-03 湖南快乐阳光互动娱乐传媒有限公司 Data restoration method and device

Also Published As

Publication number Publication date
CN111475470B (en) 2022-05-31

Similar Documents

Publication Publication Date Title
KR101597384B1 (en) Partition management in a partitioned, scalable, and available structured storage
US7363633B1 (en) Registering and storing dependencies among applications and objects in a computer system and communicating the dependencies to a recovery or backup service
JP6475304B2 (en) Transaction processing method and apparatus
CN107423426A (en) A kind of data archiving method and electronic equipment of block chain block number evidence
JP2001356945A (en) Data backup recovery system
CN109284073B (en) Data storage method, device, system, server, control node and medium
US11726883B2 (en) Fast and optimized restore using delta information
US7900088B1 (en) System for performing incremental file system check
CN103473277A (en) Snapshot method and device for file systems
CN109522160B (en) Method and system for comparing and backing up file directory by saving file information abstract
EP3474143B1 (en) Method and apparatus for incremental recovery of data
US11960363B2 (en) Write optimized, distributed, scalable indexing store
US10261863B2 (en) Runtime file system consistency checking during backup operations
CN107229540A (en) A kind of database restoring method and system based on time point
US7640454B1 (en) System and method for point-in-time recovery of application resource sets
CN115098447A (en) File recovery method and device, electronic equipment and readable storage medium
CN111475470B (en) Method and system for recovering deleted files and directories of recycle bin
CN112800019A (en) Data backup method and system based on Hadoop distributed file system
JP3985430B2 (en) Database management apparatus and method
CN112925676A (en) Method for realizing recovery of distributed database cluster at any time point based on WAL
KR101825910B1 (en) Heterogeneous database synchronization system and method using neutral data based on redo log analysis
CN111143112B (en) Method, apparatus and computer readable storage medium for restoring metadata
CN112650629A (en) Block chain index data recovery method, device, equipment and computer storage medium
CN106997305B (en) Transaction processing method and device
CN112416885B (en) Real-time file synchronization method

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
GR01 Patent grant
GR01 Patent grant