A file archiving method, system, storage medium and device
By configuring special archive users and setting storage media level ACE in Samba, the problem that the existing technology cannot meet the user's specified file storage to different media is solved, and flexible storage and archiving of files is realized, meeting users' personalized storage needs.
Patent Information
- Application Number
- CN202111222953.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-10-20
AI Technical Summary
The prior art cannot meet the user's need to specify files or directories to store them in different storage media according to actual conditions, and the traditional hierarchical storage method is not enough to achieve this function.
By configuring a special archive user in Samba and setting the ACE at the storage medium level corresponding to the user on the client, check whether the access requested user is a special archive user. If so, write the corresponding ACE in Samba's ACL, and parse its storage medium level, and write it to the extended properties of the file to realize file migration and archiving.
It realizes flexible storage and archive files, and migrates files to the corresponding storage media according to user's specifications, meeting users' personalized requirements for different file or directory storage needs.
Smart Images

Figure CN114064566B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and particularly to a file archiving method, system, storage medium and device. Background Art
[0002] In data storage, cost is usually saved through hierarchical storage. For example, cold data is placed on low-cost and slow disks, and hot data is placed on high-speed disks. Data migration is performed according to the cold and hot data algorithm, thereby reducing storage costs. However, the existing hierarchical storage is achieved by calculating through an internal algorithm which data needs to be migrated and archived.
[0003] In certain specific scenarios, the user needs to specify a certain or certain files / directories to be stored in different storage media according to the actual situation. For example, it is necessary to fixedly store files in a flash drive or directly archive them. However, the traditional hierarchical method cannot meet this situation. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a file archiving method, system, storage medium and device to solve the problem in the prior art that the hierarchical storage and archiving of specified files cannot be satisfied.
[0005] Based on the above purpose, the present invention provides a file archiving method, including the following steps:
[0006] Configure a special archiving user in Samba, and set an ACE corresponding to the special archiving user at the client, which records the storage medium level;
[0007] In response to Samba receiving an access request for a file and the corresponding ACE, check whether the user corresponding to the access request is a special archiving user;
[0008] In response to the user corresponding to the access request being a special archiving user, check the ACL in Samba to confirm whether there is an ACE of the special archiving user therein;
[0009] In response to the ACE of the special archiving user not existing in the ACL, write the ACE corresponding to the access request into the ACL as the specific ACE of the special archiving user;
[0010] Parse the specific ACE to obtain the storage medium level recorded therein, and write the recorded storage medium level into the extended attribute of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attribute of the file.
[0011] In some embodiments, checking the ACL in Samba to confirm whether there is an ACE of the special archiving user therein includes:
[0012] By checking the operation permissions of the file recorded in the ACL to confirm whether there is an ACE of a special archival user therein.
[0013] In some embodiments, checking the operation permissions of the file recorded in the ACL to confirm whether there is an ACE of a special archival user therein includes:
[0014] Checking whether the ACL records the permissions for restricted read and write operations on the file;
[0015] In response to the ACL recording the permissions for restricted read and write operations on the file, confirming that there is an ACE of a special archival user in the ACL based on the permissions for restricted read and write operations.
[0016] In some embodiments, the method further includes:
[0017] In response to there already being an ACE of a special archival user in the ACL, merging the ACE corresponding to the access request with the existing ACE.
[0018] In some embodiments, setting the ACE corresponding to the special archival user at the client side and recording the ACE at the storage medium level includes:
[0019] Setting the ACE corresponding to the special archival user at the client side, where the ACE includes multiple entries, and several of the multiple entries record the storage medium level correspondingly.
[0020] In some embodiments, configuring the special archival user in Samba includes:
[0021] Selecting an existing user in the active directory of Samba as the special archival user; or
[0022] Creating a new special archival user in the active directory of Samba.
[0023] In some embodiments, writing the recorded storage medium level into the extended attributes of the file, and migrating the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file includes:
[0024] Writing the recorded storage medium level into the extended attributes of the file, and sending a notification of successful writing to the file system;
[0025] In response to the file system receiving the notification, migrating the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
[0026] On the other hand, the present invention also provides a file archiving system, including:
[0027] The ACE setting module is configured to configure special archive users in Samba and set records of storage medium levels corresponding to the special archive users on the client side;
[0028] The checking module is configured to check whether the user corresponding to the access request is a special archive user in response to Samba receiving an access request for a file and the corresponding ACE;
[0029] The confirmation module is configured to check the ACL in Samba to confirm whether there is an ACE of the special archive user in response to the user corresponding to the access request being a special archive user;
[0030] The ACE writing module is configured to write the ACE corresponding to the access request into the ACL as a specific ACE of the special archive user in response to the non-existence of the ACE of the special archive user in the ACL;
[0031] The file archiving module is configured to parse the specific ACE to obtain the recorded storage medium level and write the recorded storage medium level into the extended attributes of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
[0032] In another aspect of the present invention, there is also provided a computer-readable storage medium storing computer program instructions, and when the computer program instructions are executed by a processor, the above method is implemented.
[0033] In still another aspect of the present invention, there is also provided a computer device including a memory and a processor, and a computer program is stored in the memory, and when the computer program is executed by the processor, the above method is executed.
[0034] The present invention has at least the following beneficial technical effects:
[0035] By setting corresponding ACEs recording storage medium levels for special archive users in the present invention, they are distinguished from other ACEs in the ACL; by checking whether the user corresponding to the access request for a file is a special archive user, and when the user corresponding to the access request is a special archive user and there is no ACE of the special archive user in the ACL in Samba, writing the ACE corresponding to the access request into the ACL and parsing the ACE, thereby obtaining the recorded storage medium level; by writing the recorded storage medium level into the extended attributes of the file and migrating the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes, the storage and archiving of files according to the storage level are flexibly realized. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other embodiments can be obtained based on these drawings.
[0037] Figure 1 Schematic diagram of a file archiving method provided according to an embodiment of the present invention;
[0038] Figure 2 Schematic diagram of a file archiving system provided according to an embodiment of the present invention;
[0039] Figure 3 Schematic diagram of a computer-readable storage medium for implementing a file archiving method provided according to an embodiment of the present invention;
[0040] Figure 4 Schematic diagram of the hardware structure of a computer device for executing a file archiving method provided according to an embodiment of the present invention. Detailed implementation manners
[0041] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0042] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are used to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units inherently includes other steps or units.
[0043] Based on the above objectives, in the first aspect of the embodiments of the present invention, an embodiment of a file archiving method is proposed. Figure 1 The following shows a schematic diagram of an embodiment of the file archiving method provided by the present invention. As Figure 1 shown, the embodiments of the present invention include the following steps:
[0044] Step S10: Configure a special archiving user in Samba, and set an ACE corresponding to the special archiving user on the client side, which records the storage medium level;
[0045] Step S20: In response to Samba receiving an access request for a file and the corresponding ACE, check whether the user corresponding to the access request is a special archiving user;
[0046] Step S30: In response to the user corresponding to the access request being a special archiving user, check the ACL in Samba to confirm whether there is an ACE of the special archiving user therein;
[0047] Step S40: In response to the non-existence of the ACE of the special archiving user in the ACL, write the ACE corresponding to the access request into the ACL as the specific ACE of the special archiving user;
[0048] Step S50: Parse the specific ACE to obtain the storage medium level recorded therein, and write the recorded storage medium level into the extended attribute of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attribute of the file.
[0049] Samba is a software that implements the SMB protocol on Linux and UNIX systems and consists of a server and client programs. SMB (Server Messages Block) is a communication protocol for sharing files and printers on a local area network, which provides shared services for resources such as files and printers among different computers within the local area network. The SMB protocol is a client / server type protocol, through which a client can access shared file systems, printers and other resources on a server.
[0050] ACL (Access Control List) is an access control technology based on packet filtering. It can filter data packets on an interface according to set conditions, allowing them to pass or discarding them. Access control lists are widely applied to routers and layer-3 switches. With the help of access control lists, the access of users to the network can be effectively controlled, thus ensuring network security to the greatest extent. ACE is an access control entry in the ACL.
[0051] In the embodiment of the present invention, by setting a corresponding ACE recording the storage medium level for the special archiving user, it is distinguished from other ACEs in the ACL; by checking whether the user corresponding to the access request for the file is a special archiving user, and when the user corresponding to the access request is a special archiving user and there is no ACE of the special archiving user in the ACL in Samba, writing the ACE corresponding to the access request into the ACL and parsing the ACE, thereby obtaining the storage medium level recorded therein; by writing the recorded storage medium level into the extended attribute of the file and migrating the file to the corresponding storage medium for archiving according to the storage medium level in the extended attribute, the storage and archiving of files according to the storage level are flexibly realized.
[0052] In some embodiments, checking the ACL in Samba to confirm the existence of the ACE of the special archival user therein includes: checking the operation permissions on the file recorded in the ACL to confirm the existence of the ACE of the special archival user therein.
[0053] In some embodiments, checking the operation permissions on the file recorded in the ACL to confirm the existence of the ACE of the special archival user therein includes: checking whether the ACL records the permissions for restricted read and write operations on the file; in response to the ACL recording the permissions for restricted read and write operations on the file, confirming the existence of the ACE of the special archival user in the ACL based on the permissions for restricted read and write operations.
[0054] In the above embodiments, for the ACE of the special archival user, it does not have the permissions for read and write operations on the file because it is mainly used to assist in storing the file to the corresponding level of storage medium; while the remaining ACEs in the ACL have the permissions for read and write operations on the file.
[0055] In some embodiments, the method further includes: in response to the existence of the ACE of the special archival user in the ACL, merging the ACE corresponding to the access request with the existing ACE.
[0056] In this embodiment, if the ACE of the special archival user already exists in the ACL, the ACE corresponding to the access request is merged with the existing ACE. Specifically, the permissions of the two are merged, that is, only one copy of the same permissions is retained, and the permissions that the ACE corresponding to the access request has more than the existing ACE are also retained.
[0057] In some embodiments, setting the ACE corresponding to the special archival user and recording the storage medium level at the client includes: setting the ACE corresponding to the special archival user at the client, where the ACE includes multiple entries, and several of the multiple entries record the storage medium level correspondingly.
[0058] In this embodiment, the client mainly includes but is not limited to a CIFS client. A CIFS client is a client that uses the CIFS protocol. The CIFS (Common Internet File System) protocol is a file sharing protocol, which is developed by Microsoft on the basis of SMB and extended to the Internet protocol. The CIFS protocol has three versions: SMB, SMB2, and SMB3. Now SMB2 and SMB3 are more commonly used. It enables programs to access files on remote Internet computers and requests services from this computer. CIFS uses the client / server mode. The client program requests services provided by the server program on the server. The server obtains the request and returns a response.
[0059] The CIFS client runs on the Windows system, and users cannot make any modifications to the client. The present invention utilizes the file system semantics of CIFS to be compatible with the original Windows applications. By setting a specific user as the archival user and setting the access control entry (ACE) of the user for files / directories, and by modifying the Samba process to parse the ACE and convert it into hierarchical storage semantics, the underlying file system or data migration process performs hierarchical archival storage according to the semantics. Based on security, the archival user has no permission to access shared files (i.e., no read / write operation permissions for shared files). ACE is a 32-bit unsigned integer string, and examples of partial conversion semantics are shown in the following table:
[0060] Table 1 Partial Conversion Semantics Table of ACE
[0061]
[0062]
[0063] In the above table, for the ACE, the semantics corresponding to the read-related permissions (such as READ_ACL, READ_ATTRIBUTES, READ_NAMED_ATTRS) are preferentially selected and set as the storage levels (such as primary storage, secondary storage, tertiary storage). The "reserved" semantics therein indicates retaining the original semantics of the ACE. Three storage levels are set in the above table. If there are multiple storage levels set, the highest storage level (such as primary storage) is selected as the selected storage level.
[0064] In some embodiments, configuring a special archival user in Samba includes: selecting an existing user in the active directory of Samba as the special archival user, or creating a new special archival user in the active directory of Samba.
[0065] In this embodiment, configuring a special archival user in Samba can change an existing user in the active directory of Samba to a special archival user, or a new special archival user can be selected.
[0066] In some embodiments, writing the recorded storage medium level into the extended attributes of a file to migrate the file to the corresponding storage medium for archival according to the storage medium level in the extended attributes of the file includes: writing the recorded storage medium level into the extended attributes of the file and sending a notification of successful writing to the file system; in response to the file system receiving the notification, migrating the file to the corresponding storage medium for archival according to the storage medium level in the extended attributes of the file.
[0067] In the second aspect of the embodiments of the present invention, a file archival system is further provided. Figure 2Shown is a schematic diagram of an embodiment of a file archiving system provided by the present invention. As Figure 2 shown, a file archiving system includes: an ACE setting module 10 configured to configure a special archiving user in Samba and set, in a client, an ACE corresponding to the special archiving user and recording a storage medium level; an inspection module 20 configured to, in response to Samba receiving an access request for a file and the corresponding ACE, inspect whether the user corresponding to the access request is a special archiving user; a confirmation module 30 configured to, in response to the user corresponding to the access request being a special archiving user, inspect the ACL in Samba to confirm whether there is an ACE of the special archiving user therein; an ACE writing module 40 configured to, in response to there being no ACE of the special archiving user in the ACL, write the ACE corresponding to the access request into the ACL as a specific ACE of the special archiving user; and a file archiving module 50 configured to parse the specific ACE to obtain the recorded storage medium level and write the recorded storage medium level into the extended attribute of the file, so as to migrate the file to a corresponding storage medium for archiving according to the storage medium level in the extended attribute of the file.
[0068] In some embodiments, the confirmation module 30 includes a special archiving user ACE confirmation module configured to confirm whether there is an ACE of the special archiving user therein by inspecting the operation permissions for the file recorded in the ACL.
[0069] In some embodiments, the special archiving user ACE confirmation module is further configured to inspect whether the ACL records the permissions for restricting read and write operations on the file; and in response to the ACL recording the permissions for restricting read and write operations on the file, confirm that there is an ACE of the special archiving user in the ACL based on the permissions for restricting read and write operations.
[0070] In some embodiments, the system further includes a merging module configured to, in response to there already being an ACE of the special archiving user in the ACL, merge the ACE corresponding to the access request with the existing ACE.
[0071] In some embodiments, the ACE setting module 10 includes a client setting module configured to set, in the client, an ACE corresponding to the special archiving user, where the ACE includes a plurality of entries, and several of the plurality of entries correspondingly record the storage medium level.
[0072] In some embodiments, the ACE setting module 10 further includes a Samba configuration module configured to select an existing user in the active directory of Samba as the special archiving user or create a new special archiving user in the active directory of Samba.
[0073] In some embodiments, the file archiving module 50 includes a file migration module configured to write the storage medium level recorded in the extended attributes of the file and send a notification of successful writing to the file system; in response to the file system receiving the notification, migrate the file to the corresponding storage medium according to the storage medium level in the extended attributes of the file for archiving.
[0074] In the file archiving system according to the embodiments of the present invention, by setting a corresponding ACE that records the storage medium level for a special archiving user, making it different from other ACEs in the ACL; by checking whether the user corresponding to the access request for the file is a special archiving user, and when the user corresponding to the access request is a special archiving user and there is no ACE of the special archiving user in the ACL in Samba, write the ACE corresponding to the access request into the ACL and parse the ACE to obtain the storage medium level recorded therein; by writing the recorded storage medium level into the extended attributes of the file and migrating the file to the corresponding storage medium according to the storage medium level in the extended attributes for archiving, the storage and archiving of files according to the storage level are flexibly realized.
[0075] In the third aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. Figure 3 The schematic diagram of the computer-readable storage medium for implementing the file archiving method according to the embodiments of the present invention is shown. As Figure 3 shown, the computer-readable storage medium 3 stores computer program instructions 31. When the computer program instructions 31 are executed by a processor, the following steps are implemented:
[0076] Configure a special archiving user in Samba and set an ACE that records the storage medium level corresponding to the special archiving user on the client side;
[0077] In response to Samba receiving an access request for a file and the corresponding ACE, check whether the user corresponding to the access request is a special archiving user;
[0078] In response to the user corresponding to the access request being a special archiving user, check the ACL in Samba to confirm whether there is an ACE of the special archiving user therein;
[0079] In response to there being no ACE of the special archiving user in the ACL, write the ACE corresponding to the access request into the ACL as the specific ACE of the special archiving user;
[0080] Parse the specific ACE to obtain the storage medium level recorded therein and write the recorded storage medium level into the extended attributes of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
[0081] In some embodiments, checking the ACL in Samba to confirm the existence of an ACE for a special archival user therein includes: checking the operation permissions on the file recorded in the ACL to confirm the existence of an ACE for a special archival user therein.
[0082] In some embodiments, checking the operation permissions on the file recorded in the ACL to confirm the existence of an ACE for a special archival user therein includes: checking whether the ACL records the permissions for restricted read and write operations on the file; in response to the ACL recording the permissions for restricted read and write operations on the file, confirming the existence of an ACE for a special archival user in the ACL based on the permissions for restricted read and write operations.
[0083] In some embodiments, the method further includes: in response to the existence of an ACE for a special archival user in the ACL, merging the ACE corresponding to the access request with the existing ACE.
[0084] In some embodiments, setting an ACE corresponding to a special archival user at the client side that records the storage medium level includes: setting an ACE corresponding to a special archival user at the client side, where the ACE includes multiple entries, and several of the multiple entries correspondingly record the storage medium level.
[0085] In some embodiments, configuring a special archival user in Samba includes: selecting an existing user in the active directory of Samba as the special archival user; or creating a new special archival user in the active directory of Samba.
[0086] In some embodiments, writing the recorded storage medium level into the extended attributes of a file to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file includes: writing the recorded storage medium level into the extended attributes of the file, and sending a notification of successful writing to the file system; in response to the file system receiving the notification, migrating the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
[0087] It should be understood that, without conflict, all the embodiments, features and advantages described above for the file archiving method according to the present invention equally apply to the file archiving system and storage medium according to the present invention.
[0088] In the fourth aspect of the embodiments of the present invention, there is also provided a computer device, including a memory 402 and a processor 401 as shown in Figure 4 wherein the memory 402 stores a computer program, and when the computer program is executed by the processor 401, the method of any one of the above embodiments is implemented.
[0089] As shown inFigure 4 As shown, it is a schematic diagram of the hardware structure of an embodiment of a computer device for the execution file archiving method provided by the present invention. Taking the computer device as shown in Figure 4 as an example, in this computer device, it includes a processor 401 and a memory 402, and may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 can be connected through a bus or other means. Figure 4 Taking the connection through the bus as an example. The input device 403 can receive input digital or character information, and generate key signal inputs related to user settings and function controls of the file archiving system. The output device 404 may include display devices such as a display screen.
[0090] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the file archiving method in the embodiments of the present application. The memory 402 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created for the use of the file archiving method, etc. In addition, the memory 402 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 402 may optionally include memories remotely set relative to the processor 401, and these remote memories can be connected to the local module through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0091] The processor 401 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 402, that is, implements the file archiving method in the above method embodiments.
[0092] Finally, it should be noted that the computer-readable storage medium (e.g., memory) of this article can be a volatile memory or a non-volatile memory, or can include both volatile memory and non-volatile memory. By way of example and not limitation, non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), and this RAM can act as an external cache memory. By way of example and not limitation, RAM can be obtained in various forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but not be limited to, these and other suitable types of memory.
[0093] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of the various illustrative components, blocks, modules, circuits, and steps. Whether this function is implemented as software or hardware depends on the particular application and the design constraints imposed on the overall system. The functions that can be implemented by those skilled in the art in various ways for each particular application, but this implementation decision should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.
[0094] The above are the exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the disclosure of the embodiments of the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein need not be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention can be described or claimed in individual form, they can also be understood as plural unless explicitly limited to the singular.
[0095] It should be understood that, as used herein, unless the context clearly supports exceptions, the singular form "a" is also intended to include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the associated listed items. The serial numbers of the disclosed embodiments of the present invention above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0096] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.
Claims
1. A file archiving method, characterized in that, it includes the following steps: Configure a special archiving user in Samba, and set an ACE corresponding to the special archiving user at the client, which records the storage medium level; In response to the access request for a file and the corresponding ACE received by the Samba, check whether the user corresponding to the access request is the special archiving user; In response to the user corresponding to the access request being the special archiving user, check the ACL in the Samba to confirm whether there is an ACE of the special archiving user therein; In response to the non-existence of the ACE of the special archiving user in the ACL, write the ACE corresponding to the access request into the ACL as the specific ACE of the special archiving user; Parse the specific ACE to obtain the recorded storage medium level, and write the recorded storage medium level into the extended attributes of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
2. The method according to claim 1, characterized in that, checking the ACL in the Samba to confirm whether there is an ACE of the special archiving user therein includes: Confirming whether there is an ACE of the special archiving user therein by checking the operation permissions on the file recorded in the ACL.
3. The method according to claim 2, characterized in that, confirming whether there is an ACE of the special archiving user therein by checking the operation permissions on the file recorded in the ACL includes: Checking whether the ACL records the permissions for restricted read and write operations on the file; In response to the ACL recording the permissions for restricted read and write operations on the file, confirm that there is an ACE of the special archiving user in the ACL based on the permissions for restricted read and write operations.
4. The method according to claim 1, characterized in that, it further includes: In response to the existence of the ACE of the special archiving user in the ACL, merge the ACE corresponding to the access request with the existing ACE.
5. The method according to claim 1, characterized in that, setting an ACE corresponding to the special archiving user at the client, which records the storage medium level, includes: Setting an ACE corresponding to the special archiving user at the client, where the ACE includes multiple entries, and several of the multiple entries correspondingly record the storage medium level.
6. The method according to claim 1, characterized in that, configuring a special archiving user in Samba includes: Selecting an existing user in the active directory of the Samba as the special archiving user; or Creating the special archiving user in the active directory of the Samba.
7. The method according to claim 1, characterized in that, writing the recorded storage medium level into the extended attributes of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file, includes: Write the recorded storage medium level into the extended attributes of the file, and send a notification of successful writing to the file system; In response to the file system receiving the notification, migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
8. A file archiving system, characterized in that, it includes: An ACE setting module, configured to configure a special archiving user in Samba and set an ACE recording the storage medium level corresponding to the special archiving user on the client; An inspection module, configured to, in response to the Samba receiving an access request for a file and the corresponding ACE, check whether the user corresponding to the access request is the special archiving user; A confirmation module, configured to, in response to the user corresponding to the access request being the special archiving user, check the ACL in the Samba to confirm whether there is an ACE of the special archiving user therein; An ACE writing module, configured to, in response to the absence of the ACE of the special archiving user in the ACL, write the ACE corresponding to the access request into the ACL as the specific ACE of the special archiving user; and A file archiving module, configured to parse the specific ACE to obtain the recorded storage medium level, and write the recorded storage medium level into the extended attributes of the file, so as to migrate the file to the corresponding storage medium for archiving according to the storage medium level in the extended attributes of the file.
9. A computer-readable storage medium, characterized in that, it stores computer program instructions, and when the computer program instructions are executed by a processor, the method described in any one of claims 1-7 is implemented.
10. A computer device, including a memory and a processor, characterized in that, a computer program is stored in the memory, and when the computer program is executed by the processor, the method described in any one of claims 1-7 is executed.
Citation Information
Patent Citations
On-line archiving and file access system
CN103294794A
Object storage-based method for data migration and system thereof
CN105843554A