A method, a terminal and a storage medium for data recovery processing of a supercomputer

By replacing the rm command in the supercomputer as the data recycling instruction and using the recycling script to process and delete data parameters, the problems of data loss and system crash during the data cleaning process are solved, and the secure migration and protection of data are achieved.

CN116185280BActive Publication Date: 2025-06-17SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211586806.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2025-06-17
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

Existing supercomputer data cleaning methods are prone to loss of important data, and system administrators are prone to errors when deleting data, resulting in system crashes or data loss.

Method used

Replace the rm commands that come with the system with data recovery instructions, and set up the user directory of the recycling bin, and process and match the deleted data parameters through the first and second recycling scripts to realize data migration and protection.

Benefits of technology

When users delete data by mistake, they can quickly retrieve data, protect important data and system files, and avoid data loss and system crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116185280B_ABST
    Figure CN116185280B_ABST
Patent Text Reader

Abstract

The present invention discloses a supercomputer data recovery processing method, terminal and storage medium, the method comprising: replacing the system's own rm command with a data recovery system, and setting a user directory of a recycle bin; processing the input deletion data parameter, and executing a first recovery script or a second recovery script according to the processed deletion data parameter; matching and data migration of the processed deletion data parameter by the first recovery script, and outputting corresponding data processing information; or matching and data migration of the processed deletion data parameter by the second recovery script, and outputting corresponding data processing information. The present invention replaces the system's own rm command with a designed data recovery system, so that the data cleaned by the user is directly transferred to another storage space, and the data can be quickly retrieved when the user deletes the data by mistake, thereby protecting important data and system files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of supercomputers, and in particular to a supercomputer data recovery processing method, terminal and storage medium. Background Art

[0002] Supercomputer systems are generally equipped with massive storage systems. However, due to factors such as the cost of running a supercomputer, the huge amount of data from supercomputer users, and the limitation of total storage capacity, supercomputer system administrators will allocate a certain amount of storage space to each user account. When user data exceeds this storage space, user operations will be interrupted and normal scientific research and production will not be able to proceed. Therefore, users need to clean up useless data in a timely manner to ensure that there is enough storage space so that operations can proceed normally.

[0003] At present, the operating system of supercomputers generally uses the Linux system, and the command for cleaning data is generally the rm command that comes with the system. When this command uses the -f parameter, there is no reminder information, and the data is deleted directly, or the -f parameter is not used, and the data is deleted with a prompt information. Later, it is found that the deletion operation is wrong, resulting in the deletion of useful data. These useful data are very important. If these data are lost, it will cause the loss of research results, and even years of research results will be reset to zero. In this case, it is very difficult to retrieve the deleted data. Even if you find a professional data repair company to perform data recovery, you may not be able to retrieve the deleted data; in another case, the system administrator has super authority and allows root to delete data. For example, when executing the command: rm-rf / home / XXX / tsest, accidentally write it wrong, rm-rf / home / XXX / tsest directly deletes the system and causes the system to crash. There are also cases where system administrators delete important databases of enterprises and institutions, resulting in the loss of important core data, causing irreversible situations.

[0004] Therefore, the prior art needs to be improved. Summary of the invention

[0005] The technical problem to be solved by the present invention is that, in view of the defects of the prior art, the present invention provides a supercomputer data recovery and processing method, terminal and storage medium to solve the technical problem that the traditional method of cleaning data is prone to losing important data.

[0006] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0007] In a first aspect, the present invention provides a supercomputer data recovery processing method, comprising:

[0008] Replace the system's built-in rm command with a data recovery instruction and set the user directory of the recycle bin; wherein the storage space of the user directory of the recycle bin is non-user storage space;

[0009] Process the input deletion data parameter and execute the first recovery script or the second recovery script according to the processed deletion data parameter;

[0010] Match and migrate the processed deletion data parameter through the first recovery script and output the corresponding data processing information;

[0011] Or match and migrate the processed deletion data parameter through the second recovery script and output the corresponding data processing information.

[0012] In one implementation, the replacing the system's built-in rm command with a data recovery instruction includes:

[0013] Add the data recovery instruction at the end of the environment configuration file of the system to replace the system's built-in rm command with the data recovery instruction.

[0014] In one implementation, the processing the input deletion data parameter and executing the first recovery script or the second recovery script according to the processed deletion data parameter includes:

[0015] Obtain the input deletion data parameter; wherein the deletion data parameter includes: file name and directory name;

[0016] Judge whether the last character of the deletion data parameter is a preset character;

[0017] If the last character of the deletion data parameter is the preset character, delete the preset character to obtain the processed deletion data parameter;

[0018] Check whether there is a file name or directory name in the user directory of the daily date directory of the recycle bin that is the same as the processed deletion data parameter;

[0019] If there is a file name or directory name in the user directory of the daily date directory of the recycle bin that is the same as the processed deletion data parameter, call the first recovery script;

[0020] If there is no file name or directory name in the user directory of the daily date directory of the recycle bin that is the same as the processed deletion data parameter, call the second recovery script.

[0021] In one implementation, the matching and migrating the processed deletion data parameter through the first recovery script and outputting the corresponding data processing information includes:

[0022] Determine whether there is a directory name with the current timestamp of the username in the directory of the current day's date in the recycle bin through the first recycling script;

[0023] If there is no directory name with the current timestamp of the username in the directory of the current day's date, establish the corresponding directory name and set the corresponding directory permissions through the first recycling script;

[0024] If there is a directory name with the current timestamp of the username in the directory of the current day's date, sequentially determine the processed delete data parameters through the first recycling script, perform data migration according to the determination result, and output the corresponding data processing information.

[0025] In one implementation, the sequentially determining the processed delete data parameters through the first recycling script, performing data migration according to the determination result, and outputting the corresponding data processing information includes:

[0026] Determine whether the processed delete data parameter contains a key character through the first recycling script;

[0027] If it contains the key character, output a prompt message indicating that there is no permission to delete the file, and exit the execution of the deletion program;

[0028] If it does not contain the key character, determine whether the first parameter of the processed delete data parameter contains -r or -f;

[0029] If the first parameter contains -r or -f, remove the first parameter, and migrate the corresponding deleted data to the directory with the current timestamp of the username, and exit the execution of the deletion program;

[0030] If the first parameter does not contain -r or -f, determine whether the first parameter contains -v;

[0031] If the first parameter contains -v, remove the first parameter, migrate the corresponding deleted data, and output the corresponding data processing information, and exit the execution of the deletion program;

[0032] If the first parameter does not contain -v, determine whether the last parameter of the delete data parameter is -v;

[0033] If the last parameter is -v, remove the last parameter, migrate the corresponding deleted data, and output the corresponding data processing information, and exit the execution of the deletion program;

[0034] If the first parameter does not contain any of -r, -f, and -v, and the last parameter is not -v, directly migrate the corresponding deleted data, output the corresponding data processing information, and exit the execution of the deletion program.

[0035] In one implementation, the second recovery script matches and migrates the processed deletion data parameters and outputs the corresponding data processing information, including:

[0036] Create a current date directory and a user directory through the second recovery script and set the corresponding directory permissions;

[0037] Sequentially determine the processed deletion data parameters through the second recovery script, perform data migration according to the determination results, and output the corresponding data processing information.

[0038] In one implementation, the second recovery script sequentially determines the processed deletion data parameters, performs data migration according to the determination results, and outputs the corresponding data processing information, including:

[0039] Determine whether the processed deletion data parameter contains a key character through the second recovery script;

[0040] If it contains the key character, output a prompt message indicating that there is no permission to delete the file and exit the execution of the deletion program;

[0041] If it does not contain the key character, determine whether the first parameter of the processed deletion data parameter contains -r or -f;

[0042] If the first parameter contains -r or -f, remove the first parameter and migrate the corresponding deleted data to the directory with the username and current timestamp, and exit the execution of the deletion program;

[0043] If the first parameter does not contain -r or -f, determine whether the first parameter contains -v;

[0044] If the first parameter contains -v, remove the first parameter, migrate the corresponding deleted data, output the corresponding data processing information, and exit the execution of the deletion program;

[0045] If the first parameter does not contain -v, determine whether the last parameter of the deletion data parameter is -v;

[0046] If the last parameter is -v, remove the last parameter, migrate the corresponding deleted data, output the corresponding data processing information, and exit the execution of the deletion program;

[0047] If the first parameter does not include any one of -r, -f and -v, and the last parameter is not -v, the corresponding deletion data is directly migrated, the corresponding data processing information is output, and the execution of the deletion program is exited.

[0048] In one implementation, the method further includes:

[0049] Use the mv command to migrate deleted data to the recycle bin.

[0050] In a second aspect, the present invention further provides a terminal, comprising: a processor and a memory, wherein the memory stores a supercomputer data recovery processing program, and when the supercomputer data recovery processing program is executed by the processor, it is used to implement the operation of the supercomputer data recovery processing method as described in the first aspect.

[0051] In a third aspect, the present invention further provides a storage medium, which is a computer-readable storage medium, and which stores a supercomputer data recovery processing program. When the supercomputer data recovery processing program is executed by a processor, it is used to implement the operation of the supercomputer data recovery processing method as described in the first aspect.

[0052] The present invention adopts the above technical solution to achieve the following effects:

[0053] The present invention replaces the system's own rm command with a designed data recovery system, so that the data cleaned by the user is directly transferred to another storage space, so that the data is migrated without the user's awareness, and the migrated data is automatically saved for a certain period of time. The present invention allows users to quickly retrieve data in the event of accidental deletion of data; at the same time, after the data is migrated to another storage space, the migrated data does not occupy the user's storage space, thereby protecting important data and system files. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0055] Figure 1 The present invention is a flowchart of a supercomputer data recovery method in one implementation mode of the present invention.

[0056] Figure 2 It is an execution flow chart of the remove.sh program in one implementation of the present invention.

[0057] Figure 3 It is an execution flow chart of the removefe.sh script in one implementation of the present invention.

[0058] Figure 4 It is an execution flow chart of the removefne.sh script in one implementation of the present invention.

[0059] Figure 5 It is a functional principle diagram of a terminal in one implementation of the present invention.

[0060] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0062] Exemplary Methods

[0063] At present, the operating system of supercomputers generally uses the Linux system, and the command for cleaning data is generally the rm command that comes with the system. When this command uses the -f parameter, there is no reminder information, and the data is deleted directly, or the -f parameter is not used, and the data is deleted with a prompt information. Later, it is found that the deletion operation is wrong, resulting in the deletion of useful data. These useful data are very important. If these data are lost, it will cause the loss of research results, and even years of research results will be reset to zero. In this case, it is very difficult to retrieve the deleted data. Even if you find a professional data repair company to perform data recovery, you may not be able to retrieve the deleted data; in another case, the system administrator has super authority and allows root to delete data. For example, when executing the command: rm-rf / home / XXX / tsest, accidentally write it wrong, rm-rf / home / XXX / tsest directly deletes the system and causes the system to crash. There are also cases where system administrators delete important databases of enterprises and institutions, resulting in the loss of important core data, causing irreversible situations.

[0064] In response to the above technical problems, an embodiment of the present invention provides a supercomputer data recovery processing method, which replaces the system's own rm command with a designed data recovery system, so that the data cleaned by the user can be directly transferred to another storage space. In the event that the user deletes data by mistake, the data can be quickly retrieved, thereby protecting important data and system files.

[0065] like Figure 1As shown, an embodiment of the present invention provides a supercomputer data recovery processing method, comprising the following steps:

[0066] Step S100, replace the system's own rm command with a data recovery instruction, and set a user directory for the recycle bin.

[0067] In this embodiment, the supercomputer data recovery processing method is applied to a terminal, and the terminal includes but is not limited to: a computer, a mobile terminal and other devices.

[0068] In this embodiment, a data recovery system is designed for supercomputing systems. The system's own rm command is replaced with the designed data recovery system. The data cleaned by the user is directly transferred to another storage space, so that the data is migrated without the user's awareness. The system automatically saves the migrated data for a certain period of time, and after a certain period of time, the system automatically clears the data. This solution allows users to quickly retrieve data when they delete data by mistake; at the same time, after the data is migrated to another storage space, the migrated data does not occupy the user's storage space; and in the design of the data recovery system, important data is protected. For example, as long as: rm / ; rm-rf / ; rm-f / ; rm-r / home, etc. are used to delete important data, they will be immediately rejected, thereby protecting important data and system files.

[0069] Specifically, in an implementation of this embodiment, step S100 includes the following steps:

[0070] Step S101, adding the data recovery instruction at the end of the environment configuration file of the system to replace the rm command provided by the system with the data recovery instruction.

[0071] In this embodiment, by adding a line of content at the end of the / etc / profile file (ie, the system environment configuration file): alias rm="sh / work / remove / remove.sh", the data recovery system can replace the system's own rm command.

[0072] After replacing the system's built-in rm command, you also need to set a user directory for the recycle bin: / scratch / recyclebin / ; wherein the storage space of the user directory of the recycle bin is non-user storage space, that is, the data in this directory does not occupy the user storage space.

[0073] like Figure 1 As shown, in one implementation of the embodiment of the present invention, the supercomputer data recovery processing method further includes the following steps:

[0074] Step S200: Process the input deletion data parameter and execute the first recovery script or the second recovery script according to the processed deletion data parameter.

[0075] In this embodiment, after setting the user directory of the recycle bin, run the remove.sh program in the data recovery system; this remove.sh program can execute different data recovery scripts according to the input deletion data parameter, that is, execute removefe.sh (i.e., the first recovery script) or removefne.sh (i.e., the second recovery script) according to the user directory in the recycle bin.

[0076] Furthermore, both the removefe.sh script and the removefne.sh script are pre-set scripts in the remove.sh program.

[0077] Specifically, in one implementation manner of this embodiment, step S200 includes the following steps:

[0078] Step S201: Obtain the input deletion data parameter;

[0079] Step S202: Determine whether the last character of the deletion data parameter is a preset character;

[0080] Step S203: If the last character of the deletion data parameter is the preset character, delete the preset character to obtain the processed deletion data parameter;

[0081] Step S204: Check whether there is a file name or directory name in the user directory of the current day's date directory in the recycle bin that is the same as the processed deletion data parameter;

[0082] Step S205: If there is a file name or directory name that is the same as the processed deletion data parameter, call the first recovery script;

[0083] Step S206: If there is no file name or directory name that is the same as the processed deletion data parameter, call the second recovery script.

[0084] In this embodiment, the deletion data parameter includes: file name and directory name.

[0085] During the execution of the remove.sh program, first obtain the input deletion data parameter. Then, determine whether the last character of the deletion data parameter is a preset character. If the last character is the preset character, delete the preset character to obtain the processed deletion data parameter. For example, the preset character can be " / ". By deleting the character " / ", the processed deletion data parameter can be obtained. If the last character is not the preset character, directly check whether there is a file name or directory name in the user directory of the current day's date directory in the recycle bin that is the same as the processed deletion data parameter.

[0086] Secondly, mainly check whether there is a file name or directory name in the user directory of the current day's date directory in the recycle bin that is the same as the processed deletion data parameter. For example: when deleting the test file, but there is already a file named test in the current date user directory of the recycle bin (for example, the location where the test file is stored: / scratch / recyclebin / 2022-12-01 / zhangsan / test). If the mv command is used to move the test file to this directory again, an error will occur. Therefore, another directory needs to be created to store the test file.

[0087] If such a file or directory exists, then call the removefe.sh script; if not, call the removefne.sh script. Calling these two different scripts will judge and match the relevant parameters of the system's built-in rm command to migrate the data without the user's perception.

[0088] As Figure 2 shown, in an application scenario, the execution process of the remove.sh program includes:

[0089] Step S11, obtain the current time in the format of year, month, and day, and assign it to the variable dateT; and obtain the user name and assign it to userN;

[0090] Step S12, obtain the deletion data parameter input by the user, such as: file name, directory name; if the last character of the parameter is " / ", then delete this character;

[0091] Step S13, determine whether there is data with the same name as the deletion data in the recycle bin, that is, determine whether the file: / scratch / recyclebin / $dateT / $userN / $argS exists; if it exists, execute Step S14; if not, execute Step S15;

[0092] Step S14, call the removefe.sh script, that is, execute: sh / work / remove / removefe.sh $*;

[0093] In step S15, call the removefne.sh script, that is, execute: sh / work / remove / removefne.sh $*.

[0094] As Figure 1 shown, in an implementation manner of the embodiment of the present invention, the supercomputer data recovery processing method further includes the following steps:

[0095] In step S300, match and migrate the processed deleted data parameters through the first recovery script, and output corresponding data processing information.

[0096] In this embodiment, during the execution of the Removefe.sh script, mainly under the directory name with the username and the current timestamp, perform instruction matching on the processed deleted data parameters, and thus execute the data migration process according to the result of the instruction matching.

[0097] Specifically, in an implementation manner of this embodiment, step S300 includes the following steps:

[0098] In step S301, use the first recovery script to determine whether there is a directory name with the username and the current timestamp in the directory of the current day's date in the recycle bin;

[0099] In step S302, if there is no directory name with the username and the current timestamp in the directory of the current day's date, use the first recovery script to create the corresponding directory name and set the corresponding directory permissions;

[0100] In step S303, if there is a directory name with the username and the current timestamp in the directory of the current day's date, use the first recovery script to sequentially discriminate the processed deleted data parameters, perform data migration according to the discrimination result, and output corresponding data processing information.

[0101] During the execution of the Removefe.sh script, determine whether the directory name with the username and the current timestamp exists. If it does not exist, create the directory name and set the directory permissions to 700;

[0102] For example: If there is already a test file in / scratch / recyclebin / 2022-12-01 / zhangsan / , then a new directory needs to be created to store this file. The newly created directory is: / scratch / recyclebin / 2022-12-01 / zhangsan1669859277, and then move the test file to this directory; before creating the directory, first check whether / scratch / recyclebin / 2022-12-01 / zhangsan1669859277 exists.

[0103] If it exists, the following judgment process is performed on the parameters of the processed deleted data.

[0104] Specifically, in one implementation manner of this embodiment, step S303 includes the following steps:

[0105] Step S303a, determine whether the processed deleted data parameter contains a key character through the first recycling script;

[0106] Step S303b, if the key character is included, output a prompt message indicating that there is no permission to delete the file, and exit the execution of the deletion program;

[0107] Step S303c, if the key character is not included, determine whether the first parameter of the processed deleted data parameter contains -r or -f;

[0108] Step S303d, if the first parameter contains -r or -f, remove the first parameter, and migrate the corresponding deleted data to the directory with the username and current timestamp, and exit the execution of the deletion program;

[0109] Step S303e, if the first parameter does not contain -r or -f, determine whether the first parameter contains -v;

[0110] Step S303f, if the first parameter contains -v, remove the first parameter, migrate the corresponding deleted data, and output the corresponding data processing information, and exit the execution of the deletion program;

[0111] Step S303g, if the first parameter does not contain -v, determine whether the last parameter of the deleted data parameter is -v;

[0112] Step S303h, if the last parameter is -v, remove the last parameter, migrate the corresponding deleted data, and output the corresponding data processing information, and exit the execution of the deletion program;

[0113] Step S303i, if the first parameter does not contain any of -r, -f, and -v, and the last parameter is not -v, directly migrate the corresponding deleted data, output the corresponding data processing information, and exit the execution of the deletion program.

[0114] In this embodiment, during the process of the removefe.sh script matching and judging the processed deletion data parameters, first judge whether it contains the key characters " / ", " / share", " / data", " / scratch", " / work". If it contains, directly exit the deletion program.

[0115] Then continue to judge the processed deletion data parameters. If the first parameter is "-r" or contains "f", after removing the first parameter, directly migrate the data and then exit the deletion program;

[0116] Then continue to judge the processed deletion data parameters. If the first parameter is "-v", after removing the first parameter, migrate the data, print the information, and exit the deletion program;

[0117] Then continue to judge the processed deletion data parameters. If the last parameter is "-v", after removing the last parameter, migrate the data, print the information, and exit the deletion program.

[0118] During the above matching and judging process, if none of the corresponding parameters are involved (that is, the first parameter is not "-r" or does not contain "-f", nor is it "-v"; the last parameter is not "-v"; the processed deletion data parameters do not contain the key characters), then use the mv command to migrate the processed deletion data to the recycle bin and exit the deletion program.

[0119] As Figure 3 shown, in an application scenario, the execution process of the Removefe.sh script includes:

[0120] Step S21, obtain the last column of the deletion data parameter, assign it to lastStr, obtain the current time in the format of year-month-day, assign it to the variable dateT; obtain the user name, assign it to userN; obtain the timestamp, assign it to sT;

[0121] Step S22, judge whether the directory named by the user name and timestamp exists, that is, judge whether the directory / work / recyclebin / $dateT / $userNsT exists; if not, execute step S23; if so, execute step S24;

[0122] In step S23, create a directory, i.e., create: mkdir / work / recyclebin / $dateT / $userN$sT, and set the directory permission to 700;

[0123] In step S24, determine whether it contains the key characters " / ", " / share", " / data", " / scratch", " / work"; if yes, execute step S25; if no, execute step S26;

[0124] In step S25, print the information of no permission to delete and exit the program;

[0125] In step S26, determine whether the first parameter of the delete data parameter contains "-r" or "f"; if yes, execute step S27; if no, execute step S28;

[0126] In step S27, after removing the first one of the delete data parameters, use the mv command to migrate the delete data to the recycle bin and exit the program;

[0127] In step S28, determine whether the first parameter of the delete data parameter is "-v"; if yes, execute step S29; if no, execute step S30;

[0128] In step S29, after removing the first one of the delete data parameters, use the mv command to migrate the delete data to the recycle bin, print the information that the data has been migrated to the recycle bin, and exit the program;

[0129] In step S30, determine whether the last parameter of the delete data parameter is "-v"; if yes, execute step S31; if no, execute step S32;

[0130] In step S31, after removing the last one of the delete data parameters, use the mv command to migrate the delete data to the recycle bin. Print the information that the data has been migrated to the recycle bin and exit the program;

[0131] In step S32, use the mv command to migrate the delete data to the recycle bin and exit the program.

[0132] As Figure 1 shown, in one implementation manner of the embodiment of the present invention, the supercomputer data recovery processing method further includes the following steps:

[0133] In step S400, match and migrate the processed delete data parameter through the second recovery script, and output the corresponding data processing information.

[0134] In this embodiment, during the execution of the removefne.sh script, mainly under the time directory and user directory, instruction matching is performed on the delete data parameters, and then the data migration process is executed according to the result of the instruction matching.

[0135] Specifically, in one implementation manner of this embodiment, step S400 includes the following steps:

[0136] Step S401, create the current date directory and user directory through the second recycling script, and set the corresponding directory permissions;

[0137] Step S402, sequentially determine the processed delete data parameters through the second recycling script, perform data migration according to the determination result, and output the corresponding data processing information.

[0138] During the execution of the removefne.sh script, determine whether the time directory exists. If it does not exist, create the time directory and set the directory permission to 777; furthermore, determine whether the user directory exists. If it does not exist, create the user directory, and for safety reasons, set the directory permission to 700.

[0139] Furthermore, after creating the time directory, user directory, and corresponding permissions, the following judgment process is carried out.

[0140] Specifically, in one implementation manner of this embodiment, step S402 includes the following steps:

[0141] Step S402a, determine whether the delete data parameter contains a key character through the second recycling script;

[0142] Step S402b, if it contains the key character, output a prompt message indicating that there is no permission to delete the file, and exit the execution of the delete program;

[0143] Step S402c, if it does not contain the key character, determine whether the first parameter of the processed delete data parameter contains -r or -f;

[0144] Step S402d, if the first parameter contains -r or -f, remove the first parameter, and migrate the corresponding delete data to the directory with the username and current timestamp, and exit the execution of the delete program;

[0145] Step S402e, if the first parameter does not contain -r or -f, determine whether the first parameter contains -v;

[0146] Step S402f, if the first parameter contains -v, remove the first parameter, migrate the corresponding deletion data, output the corresponding data processing information, and exit the execution of the deletion program;

[0147] Step S402g, if the first parameter does not contain -v, determine whether the last parameter of the deletion data parameter is -v;

[0148] Step S402h, if the last parameter is -v, remove the last parameter, migrate the corresponding deletion data, output the corresponding data processing information, and exit the execution of the deletion program;

[0149] Step S402i, if the first parameter does not contain any one of -r, -f, and -v, and the last parameter is not -v, directly migrate the corresponding deletion data, output the corresponding data processing information, and exit the execution of the deletion program.

[0150] In this embodiment, during the process of the removefne.sh script matching and judging the processed deletion data parameter, first judge whether it contains the key characters " / ", " / share", " / data", " / scratch", " / work", and if it contains, directly exit the deletion program.

[0151] Then continue to judge the processed deletion data parameter. If the first parameter is "-r" or contains "f", after removing the first parameter, directly migrate the data and exit the deletion program;

[0152] Then continue to judge the parameter of the processed deletion data. If the first parameter is "-v", after removing the first parameter, migrate the data, print the information, and exit the deletion program;

[0153] Then continue to judge the parameter of the processed deletion data. If the last parameter is "-v", after removing the last parameter, migrate the data, print the information, and exit the deletion program.

[0154] During the above matching and judging process, if none of the corresponding parameters are involved (that is, the first parameter is not "-r" or does not contain "f", nor is it "-v"; the last parameter is not "-v"; the processed deletion data parameter does not contain the key characters), then use the mv command to migrate the processed deletion data to the recycle bin and exit.

[0155] Such as Figure 4 , in an application scenario, the execution process of the removefne.sh script includes:

[0156] Step S41: Obtain the last column of the deletion data parameter, assign it to lastStr, obtain the current time in the format of year-month-day, assign it to the variable dateT; obtain the user name, assign it to userN; obtain the timestamp, assign it to sT.

[0157] Step S42: Determine whether the directory named after the time exists, that is, determine whether / work / recyclebin$dateT exists; if not, execute Step S43; if so, execute Step S44.

[0158] Step S43: Create a directory named after the time, that is: mkdir / work / recyclebin / $dateT, and set the directory permissions to 777.

[0159] Step S44: Determine whether the directory named after the user exists, that is, determine whether / work / recyclebin / $dateT / $userN exists; if not, execute Step S45; if so, execute Step S46.

[0160] Step S45: Create a directory named after the user name and timestamp, that is, create: mkdir / work / recyclebin / SdateT / SuserN, and set the directory permissions to 700.

[0161] Step S46: Determine whether it contains the key characters " / ", " / share", " / data", " / scratch", " / work"; if so, execute Step S47; if not, execute Step S48.

[0162] Step S47: Print the information that there is no permission to delete, and exit the program.

[0163] Step S48: Determine whether the first parameter of the deletion data parameter contains "-r" or "f"; if so, execute Step S49; if not, execute Step S50.

[0164] Step S49: After removing the first one of the deletion data parameters, use the mv command to migrate the deletion data to the recycle bin, and exit the program.

[0165] Step S50: Determine whether the first parameter of the deletion data parameter is "-v"; if so, execute Step S51; if not, execute Step S52.

[0166] Step S51: After removing the first one of the deletion data parameters, use the mv command to migrate the deletion data to the recycle bin, print the information that the data has been migrated to the recycle bin, and exit the program.

[0167] Step S52: Determine whether the last parameter of the data deletion parameter is "-v". If it is, execute Step S53; if not, execute Step S54;

[0168] Step S53: After removing the last one of the data deletion parameters, use the mv command to migrate the deleted data to the recycle bin. Print the information that the data has been migrated to the recycle bin and exit the program;

[0169] Step S54: Use the mv command to migrate the deleted data to the recycle bin and exit the program.

[0170] In an implementation manner of the embodiment of the present invention, the supercomputer data recovery processing method further includes the following steps:

[0171] Step S500: Use the mv command to migrate the deleted data to the recycle bin.

[0172] In this embodiment, during the execution of the remove.sh program, whether it is the matching judgment process of the removefe.sh script or the removefne.sh script, if no corresponding parameter characters are matched, directly use the mv command to migrate the deleted data to the recycle bin.

[0173] In this embodiment, the following scheduled tasks can be set:

[0174] 0 23 *** root sh / work / remove / rmRubbish.sh, scheduled to empty the recycle bin; for example, set to clean all the date directories in the recycle bin that are not of the current day at 10 pm every day. For the user, the data in the recycle bin will be automatically cleaned by the system after 2 days of storage.

[0175] This embodiment achieves the following technical effects through the above technical solutions:

[0176] This embodiment replaces the system's built-in rm command with the designed data recovery system, enabling the data cleared by the user to be directly transferred to another storage space. In this way, without the user's awareness, the data is migrated and the migrated data is automatically saved for a certain period of time. This embodiment allows the user to quickly retrieve data in case of accidental deletion; at the same time, after the data is migrated to another storage space, the migrated data does not occupy the user's storage space, thus protecting important data and system files.

[0177] Exemplary device

[0178] Based on the above embodiments, the present invention further provides a terminal, including: a processor, a memory, an interface, a display screen, and a communication module connected through a system bus; wherein, the processor is used to provide computing and control capabilities; the memory includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is used to connect external devices, such as mobile terminals and computers, etc.; the display screen is used to display corresponding information; the communication module is used to communicate with a cloud server or a mobile terminal.

[0179] When the computer program is executed by the processor, it is used to implement the operations of a supercomputer data recovery processing method.

[0180] Those skilled in the art can understand that Figure 5 the principle block diagram shown in is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0181] In one embodiment, a terminal is provided, including: a processor and a memory, the memory stores a supercomputer data recovery processing program, and when the supercomputer data recovery processing program is executed by the processor, it is used to implement the operations of the supercomputer data recovery processing method as described above.

[0182] In one embodiment, a storage medium is provided, wherein the storage medium stores a supercomputer data recovery processing program, and when the supercomputer data recovery processing program is executed by the processor, it is used to implement the operations of the supercomputer data recovery processing method as described above.

[0183] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments of the method can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile storage medium. When the computer program is executed, it can include the processes of the above embodiments of the methods. Among them, any reference to a memory, a database, or other media used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories.

[0184] In summary, the present invention provides a supercomputer data recovery processing method, terminal and storage medium, the method comprising: replacing the system's own rm command with a data recovery instruction, and setting a user directory of a recycle bin; processing the input deletion data parameter, and executing a first recovery script or a second recovery script according to the processed deletion data parameter; matching and migrating the processed deletion data parameter through the first recovery script, and outputting corresponding data processing information; or matching and migrating the processed deletion data parameter through the second recovery script, and outputting corresponding data processing information. The present invention replaces the system's own rm command with a designed data recovery system, so that the data cleaned by the user is directly transferred to another storage space, and the data can be quickly retrieved when the user deletes the data by mistake, thereby protecting important data and system files.

[0185] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for recycling and processing supercomputer data, characterized in that, include: Replace the system's built-in rm command with a data recovery command and set the user directory for the recycle bin; The storage space of the user directory of the recycle bin is non-user storage space; Processing the input deletion data parameter, and executing the first recovery script or the second recovery script according to the processed deletion data parameter; Matching and migrating the processed deleted data parameters through the first recovery script, and outputting corresponding data processing information; or matching and data migration of the processed deleted data parameters through the second recovery script, and outputting corresponding data processing information; The step of processing the input deletion data parameter and executing the first recovery script or the second recovery script according to the processed deletion data parameter includes: Obtain input deletion data parameters; wherein the deletion data parameters include: file name and directory name; Determine whether the last character of the deletion data parameter is a preset character; If the last character of the deletion data parameter is the preset character, the preset character is deleted to obtain the processed deletion data parameter; Find out whether there is a file name or directory name that is the same as the processed deleted data parameter in the user directory of the current date directory of the recycle bin; If there is a file name or directory name that is the same as the processed deleted data parameter, calling the first recycling script; If there is no file name or directory name identical to the processed deleted data parameter, calling the second recycling script; The first recovery script is used to match and migrate the processed deleted data parameters, and output corresponding data processing information, including: Determine by the first recycling script whether there is a directory named with the current timestamp of the user name in the directory of the current date in the recycling bin; If there is no directory name with the current timestamp of the user name in the directory of the current date, create a corresponding directory name and set corresponding directory permissions through the first recovery script; If there is a directory name with the current timestamp of the user name in the directory of the current date, the first recovery script is used to sequentially identify the processed deleted data parameters, and data migration is performed according to the identification result, and corresponding data processing information is output; The second recovery script is used to match and migrate the processed deleted data parameters, and output corresponding data processing information, including: Using the second recovery script, a current date directory and a user directory are created, and corresponding directory permissions are set; The processed deleted data parameters are sequentially identified by the second recycling script, and data migration is performed according to the identification result, and corresponding data processing information is output.

2. The method for recycling and processing supercomputer data according to claim 1, characterized in that, The method of replacing the system's built-in rm command with a data recovery command includes: The data recovery instruction is added at the end of the environment configuration file of the system to replace the rm command provided by the system with the data recovery instruction.

3. The method for recycling and processing supercomputer data according to claim 1, characterized in that, The first recovery script sequentially determines the processed deleted data parameters, performs data migration according to the determination results, and outputs corresponding data processing information, including: Determine whether the processed deletion data parameter contains a key character through the first recovery script; If the key character is included, output a prompt message indicating that there is no permission to delete the file, and exit the execution of the deletion program; If the key character is not included, determine whether the first parameter of the processed deletion data parameter contains -r or -f; If the first parameter contains -r or -f, remove the first parameter, and migrate the corresponding deletion data to the directory with the username and current timestamp, and exit the execution of the deletion program; If the first parameter does not contain -r or -f, determine whether the first parameter contains -v; If the first parameter contains -v, remove the first parameter, migrate the corresponding deletion data, and output the corresponding data processing information, and exit the execution of the deletion program; If the first parameter does not contain -v, determine whether the last parameter of the deletion data parameter is -v; If the last parameter is -v, remove the last parameter, migrate the corresponding deletion data, and output the corresponding data processing information, and exit the execution of the deletion program; If the first parameter does not contain any one of -r, -f, and -v, and the last parameter is not -v, directly migrate the corresponding deletion data, output the corresponding data processing information, and exit the execution of the deletion program.

4. The method for recycling and processing supercomputer data according to claim 1, characterized in that, The second recovery script sequentially discriminates the processed deletion data parameter, performs data migration according to the discrimination result, and outputs the corresponding data processing information, including: Determine whether the processed deletion data parameter contains a key character through the second recovery script; If the key character is included, output a prompt message indicating that there is no permission to delete the file, and exit the execution of the deletion program; If the key character is not included, determine whether the first parameter of the processed deletion data parameter contains -r or -f; If the first parameter contains -r or -f, remove the first parameter, and migrate the corresponding deletion data to the directory with the username and current timestamp, and exit the execution of the deletion program; If the first parameter does not contain -r or -f, determine whether the first parameter contains -v; If the first parameter contains -v, remove the first parameter, migrate the corresponding deletion data, and output the corresponding data processing information, and exit the execution of the deletion program; If the first parameter does not contain -v, determine whether the last parameter of the deletion data parameter is -v; If the last parameter is -v, remove the last parameter, migrate the corresponding deletion data, and output the corresponding data processing information, and exit the execution of the deletion program; If the first parameter does not contain any one of -r, -f, and -v, and the last parameter is not -v, directly migrate the corresponding deletion data, output the corresponding data processing information, and exit the execution of the deletion program.

5. The supercomputer data recovery processing method according to claim 1, characterized in that, It also includes: Use the mv command to migrate the deletion data to the recycle bin.

6. A terminal, characterized in that, Include: A processor and a memory, the memory storing a supercomputer data recovery processing program, which is used to implement the operations of the supercomputer data recovery processing method according to any one of claims 1-5 when executed by the processor.

7. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, the storage medium storing a supercomputer data recovery processing program, which is used to implement the operations of the supercomputer data recovery processing method according to any one of claims 1-5 when executed by a processor.

Citation Information

Patent Citations

  • Data deletion method, system and device and computer readable storage medium

    CN109992213A

  • Resource Reclamation in Data Storage

    US20100070734A1