Scheduled task diagnosis method and device

By batch checking and diagnosing the timing task execution log of the Linux server, the cumbersome problems of timing task configuration and modification are solved, efficient diagnosis and effectiveness of timing tasks are achieved, operation and maintenance costs are reduced, and operation and maintenance efficiency is improved.

CN111897710BActive Publication Date: 2024-11-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010848134.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-21
Publication Date
2024-11-12
Estimated Expiration
2040-08-21

AI Technical Summary

Technical Problem

In the prior art, the configuration and modification of crontab timing tasks on the linux server have duplicate operations and are difficult to maintain, and the tasks are not effective due to script permissions or environment variables, which increases the obstacles to server operation and maintenance.

Method used

Provide a timed task diagnosis method and device, which collects the server's timed task execution logs and performs batch checks and diagnosis, including checking whether the timed task program, background process, time zone, environment variables and cycles meet the standards, finding the error content, and according to Predefined keywords determine the cause of the error and redefine the startup time point.

Benefits of technology

It realizes batch setting and diagnosis of Linux operating system timing tasks, reduces operation and maintenance costs, improves task generation efficiency and reliability, and reduces the complexity of operation and maintenance work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111897710B_ABST
    Figure CN111897710B_ABST
Patent Text Reader

Abstract

The scheduled task diagnosis method and device provided by the present invention first collect the scheduled task execution logs generated by multiple servers respectively; then finally diagnose the scheduled tasks executed by each server according to each scheduled task execution log, and generate a scheduled task diagnosis result, so that the present invention can diagnose the scheduled tasks of each server, and the diagnosis process does not limit the number of scheduled tasks, so that the scheduled tasks of the Linux operating system can be set and diagnosed in batches, and crontab scheduled tasks can be set in batches on a large scale, effectively reducing the operation and maintenance costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of task diagnosis, and in particular to a method and device for diagnosing a scheduled task. Background Art

[0002] At present, Linux servers are the mainstream operating systems for production and operation in enterprise data centers. Due to business needs, various applications are running on Linux servers, and the number of servers has also increased massively with the expansion of business. Each server with a Linux operating system needs to customize its own crontab scheduled tasks according to actual needs, and the configuration and modification of crontab scheduled tasks have problems such as repeated and cumbersome operations and difficult maintenance. Moreover, after each modification is completed, there are situations where the modification does not take effect due to problems such as script permissions or environment variables, which adds obstacles to the operation and maintenance of the server. The existing technology can only log in to the server manually one by one and modify the crontab tasks one by one, which has a certain degree of operation and maintenance bottleneck. This system is a system and method for batch setting and diagnosis of Linux operating system scheduled tasks based on Web. Summary of the invention

[0003] In view of the problems in the prior art, the present invention provides a timed task diagnosis method and device.

[0004] In one aspect of the present invention, a timed task diagnosis method comprises:

[0005] Collect scheduled task execution logs generated by multiple servers;

[0006] The scheduled tasks executed by each server are diagnosed according to each scheduled task execution log to generate scheduled task diagnosis results.

[0007] In some embodiments, before the scheduled task is executed by the corresponding server, at least one of the following steps is further included:

[0008] Check whether the server has a scheduled task program;

[0009] Check whether the scheduled task background process is started;

[0010] Check the time zone of the scheduled task;

[0011] Check the environment variables of the scheduled task execution environment;

[0012] Check whether the scheduled task period complies with the scheduled task format standard.

[0013] In some embodiments, the diagnosing the scheduled tasks executed by each server according to each scheduled task execution log and generating the scheduled task diagnosis result includes:

[0014] Check whether the specified application user script has execution permission, and if not, grant permission to the application user;

[0015] Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

[0016] In some embodiments, if within a set time period,

[0017] If the scheduled task is not triggered, check whether the start time point set for the scheduled task is consistent with the actual execution time point. If not, re-set the start time point for the scheduled task.

[0018] Another aspect of the present invention is a timed task diagnosis device, comprising:

[0019] The collection module collects the scheduled task execution logs generated by multiple servers;

[0020] The diagnosis module diagnoses the scheduled tasks executed by each server according to each scheduled task execution log and generates scheduled task diagnosis results.

[0021] In some embodiments, a checking module is further included, wherein the checking module includes at least one of the following units:

[0022] Scheduled task program checking unit, checking whether the server has a scheduled task program;

[0023] The background startup check unit checks whether the scheduled task background process is started;

[0024] Time zone checking unit, checks the time zone of scheduled tasks;

[0025] Environment variable checking unit, checks the environment variables of the scheduled task execution environment;

[0026] The format checking unit checks whether the scheduled task cycle complies with the scheduled task format standard.

[0027] In some embodiments, the diagnostic module comprises:

[0028] Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

[0029] In some embodiments, if within a set time period,

[0030] If the scheduled task is not triggered, check whether the start time point set for the scheduled task is consistent with the actual execution time point. If not, re-set the start time point for the scheduled task.

[0031] Another aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the timed task diagnosis method when executing the program.

[0032] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements a timed task diagnosis method when executed by a processor.

[0033] It can be seen from the above technical scheme that the scheduled task diagnosis method and device provided by the present invention first collect the scheduled task execution logs generated by multiple servers respectively; then finally diagnose the scheduled tasks executed by each server according to each scheduled task execution log, and generate a scheduled task diagnosis result, so that the present invention can diagnose the scheduled tasks of each server, and the diagnosis process does not limit the number of scheduled tasks. The scheduled tasks of the Linux operating system can be set and diagnosed in batches, so as to achieve batch and large-scale setting of crontab scheduled tasks, effectively reducing operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 The figure is a flow chart of a method for diagnosing scheduled tasks in an embodiment of the present invention.

[0036] Figure 2 This is one of the flowcharts of some steps in the embodiment of the present invention.

[0037] Figure 3 This is the second flow chart of some steps in the embodiment of the present invention.

[0038] Figure 4 This is the third flow chart of some steps in the embodiment of the present invention.

[0039] Figure 5 The figure is a schematic diagram of the structure of a timing task diagnosis device in an embodiment of the present invention.

[0040] Figure 6 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] The first embodiment of the present invention provides a timed task diagnosis method, such as Figure 1 As shown, including:

[0043] S1: Collects scheduled task execution logs generated by multiple servers;

[0044] S2: diagnose the scheduled tasks executed by each server according to each scheduled task execution log, and generate scheduled task diagnosis results.

[0045] The scheduled task diagnosis method provided by the present invention first collects the scheduled task execution logs generated by multiple servers respectively; then finally diagnoses the scheduled tasks executed by each server according to each scheduled task execution log, and generates a scheduled task diagnosis result, so that the present invention can diagnose the scheduled tasks of each server, and the diagnosis process does not limit the number of scheduled tasks, so that the Linux operating system scheduled tasks can be set and diagnosed in batches, and crontab scheduled tasks can be set in batches on a large scale, effectively reducing operation and maintenance costs.

[0046] Specifically, in step S1, Figure 2 As shown, on the user side, the user interacts with the system on a unified web management platform. According to actual needs, the user needs to fill in Excel first to specify which specific Linux servers need to be deployed with specific scheduled task scripts. Then upload the Excel to the web management platform, and then the server parses the Excel uploaded by the user and verifies the correctness of the content, including whether the target server exists, whether the target server is a Linux server, whether the executing user exists, whether the scheduled task script exists, etc. When all the above checks are verified, the batch configuration of crontab scheduled tasks is completed.

[0047] In some embodiments, since the scheduled task execution log corresponds to each server, it can be processed in parallel and batch configured for scheduled tasks. For example, the following batch configuration operations can be performed:

[0048] 1. The administrator will register the list of Linux servers that need to be uniformly scheduled on the web, including (target server IP, root username, password). The web platform will perform unified scheduling management on all managed servers, such as Figure 3 shown.

[0049] Management content: (add / delete crontab permissions for any user, automatically send crontab tasks in batches at a scheduled time, and roll back backup files in batches according to the specified date)

[0050] 1. Not all users have crontab task permissions. The root user needs to grant unified permissions to add crontab permissions to any user.

[0051] 2. Before the crontab task is sent, back up the user's crontab (by date, hour, minute, and second) and back it up to the target server.

[0052] 3. The platform can automatically send batches at a scheduled time according to the time specified by the user (triggered by background thread scanning)

[0053] 4. The automatically issued crontab task list does not affect the original crontab tasks. If the existing ones exist, they will be modified; if not, they will be added.

[0054] If you find that there is a problem with the crontab task settings and need to roll back, you can check the previous backup list through the web management platform, and the user can specify the backup file of a certain date to be restored to achieve the rollback.

[0055] In addition, in the present invention, Figure 4 As shown, the task configuration can also be triggered when receiving the relevant notification, which includes checking whether the executing user has the crontab scheduled task authority, granting authority if not, checking the original crontab task of the user, and writing the original crontab task into a temporary file, and modifying and configuring the original temporary file according to the newly added or modified crontab task list filled in by the user. After the modification is completed, the crontab scheduled task is effective through the modified temporary file.

[0056] After configuring the scheduled task, you can perform the automatic diagnosis function. When the crontab task that has been implemented has taken effect normally, you need to wait for the first execution of the scheduled task to be completed. The web management platform will collect the execution log of the crontab task filled in by the user and return the collection results to the web management platform. Users can clearly see the execution status of a specific configured task of each Linux server on the web management platform and know whether the task is effective.

[0057] The present invention further includes at least one of the following steps before the scheduled task is executed by the corresponding server:

[0058] Check whether the server has a scheduled task program;

[0059] Check whether the scheduled task background process is started;

[0060] Check the time zone of the scheduled task;

[0061] Check the environment variables of the scheduled task execution environment;

[0062] Check whether the scheduled task period complies with the scheduled task format standard.

[0063] Specifically, as follows:

[0064] 1. Automatically check whether the Linux server has a crontab program.

[0065] The platform determines the Linux distribution system version and automatically installs the crontab program.

[0066] 2. Automatically check whether the crond service is started.

[0067] The platform automatically checks whether the crontab background process is started and automatically executes the crond service startup command.

[0068] 3. Automatically check the time zone of crontab tasks.

[0069] Display the time zone of the current crontab task and return it to the user. The user can also specify a fixed time zone.

[0070] 4. Automatically check all environment variables of the crontab environment (the environment variables of the crontab are independent of the environment variables of the application user).

[0071] Display all environment variables of the current crontab task and return them to the user, who can add them manually according to actual needs.

[0072] 5. Automatically check whether the user's customized crontab scheduled task cycle conforms to the crontab format standard.

[0073] In addition, for the collection of log information, there are two types of logs for tasks scheduled by crontab:

[0074] 1. Record log started by crontab.

[0075] The first type of crontab startup log only records two types of information, the script execution time and the name of the executed script. This log is a key indicator of whether the scheduled task script has generated a scheduled task. There is a log of the script at a specified time point (that is, it indicates that the scheduled task script can be triggered, but it may not be effective).

[0076] 2. User-defined sh script log.

[0077] The log itself is output with the console, but because crontab is a task executed in the background, the relevant log will not be displayed in the window, and the log itself will not have any relevant records in the log file. (The platform uses a special method to realize the original log output to the console and output it to the log file, which can record and track the execution of the sh script log).

[0078] The second type of user-defined sh script execution log is a reference standard for checking whether crontab execution is effective.

[0079] The platform collects the above two logs through the automatic log recovery device.

[0080] Furthermore, the diagnostic step of the present invention comprises:

[0081] Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

[0082] For example, if the keyword is "command not found", based on the keyword and the corresponding relationship "command not found", it is determined that the error content is "command not found". The same applies to other keywords, which are not elaborated here.

[0083] Specifically, currently, the system automatically diagnoses and assists in guiding users to correctly configure crontab tasks based on user-defined sh script logs.

[0084] 1. Automatically check whether the specified application user script has execution permission for the script. If not, automatically grant it with root advanced permissions.

[0085] 2. Use the user-defined sh script log to locate the keywords of the environment variables. Because the variables are user-defined values, the platform implements adding variables with specified values ​​for users, and the values ​​of the environment need to be set by the user.

[0086] 3. Through the user-defined sh script log to the path error and other keywords, according to the error content (relative path does not exist), prompt the user that the relative path in the sh script is incorrectly filled in and needs to be modified to an absolute path.

[0087] 4. If the scheduled task is not triggered at the specified time point, the platform will automatically check the time point of the scheduled task to verify whether it is consistent with the actual execution time. If it is unknown, the time zone required by the crontab task is different from the actual value. Users can customize the specified time zone through the platform.

[0088] Furthermore, it can be known that if the scheduled task is not triggered within the set time period, it is checked whether the start time point set for the scheduled task is consistent with the actual execution time point. If not, the start time point of the scheduled task is re-set.

[0089] From the above analysis, it can be seen that in order to solve the problem that the traditional method relies heavily on manual work, and there is a problem that the task configuration is not effective after completion and it is difficult to locate the cause of the problem, the present invention realizes the batch setting and diagnosis of Linux operating system scheduled tasks, and can achieve batch and large-scale setting of crontab scheduled tasks, and can provide timely feedback on the execution status of scheduled tasks, and clarify whether the scheduled tasks are effective in time. This invention greatly improves the efficiency of operation and maintenance work and effectively reduces operation and maintenance costs.

[0090] Based on the same inventive concept, the present invention also provides a timing task diagnosis device, such as Figure 5 As shown, including:

[0091] Collection module 1, collects data generated by multiple servers

[0092] Diagnostic module 2 diagnoses the scheduled tasks executed by each server according to each scheduled task execution log and generates a scheduled task diagnosis result.

[0093] The scheduled task diagnosis device provided by the present invention first collects the scheduled task execution logs generated by multiple servers respectively; then finally diagnoses the scheduled tasks executed by each server according to each scheduled task execution log, and generates a scheduled task diagnosis result, so that the present invention can diagnose the scheduled tasks of each server, and the diagnosis process does not limit the number of scheduled tasks, so that the Linux operating system scheduled tasks can be set and diagnosed in batches, and crontab scheduled tasks can be set in batches on a large scale, effectively reducing operation and maintenance costs.

[0094] Based on the same inventive concept, in some embodiments, an inspection module is further included, and the inspection module includes at least one of the following units:

[0095] Scheduled task program checking unit, checking whether the server has a scheduled task program;

[0096] The background startup check unit checks whether the scheduled task background process is started;

[0097] Time zone checking unit, checks the time zone of scheduled tasks;

[0098] Environment variable checking unit, checks the environment variables of the scheduled task execution environment;

[0099] The format checking unit checks whether the scheduled task cycle complies with the scheduled task format standard.

[0100] Based on the same inventive concept, in certain embodiments, the diagnosis module includes:

[0101] Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

[0102] Based on the same inventive concept, in some embodiments, if within a set time period,

[0103] If the scheduled task is not triggered, check whether the start time point set for the scheduled task is consistent with the actual execution time point. If not, re-set the start time point for the scheduled task.

[0104] From the hardware level, in order to provide an embodiment of an electronic device for implementing all or part of the contents of the scheduled task diagnosis method in the present invention, the electronic device specifically includes the following contents:

[0105] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between related devices such as servers, devices, distributed message middleware cluster devices, various databases and user terminals; the electronic device can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the electronic device can be implemented with reference to the embodiment of the timed task diagnosis method in the embodiment, and the embodiment of the diagnosis device, the contents of which are incorporated herein, and the repeated parts are not repeated.

[0106] Figure 6 FIG. 9 is a schematic block diagram of a system structure of an electronic device 9600 according to an embodiment of the present invention. Figure 6 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 6 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0107] In one embodiment, the diagnostic function can be integrated into the central processing unit 9100.

[0108] In another embodiment, the diagnostic device may be configured separately from the central processing unit 9100. For example, the diagnostic device may be configured as a chip connected to the central processing unit 9100, and the diagnostic function may be implemented under the control of the central processing unit.

[0109] like Figure 6 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 6 In addition, the electronic device 9600 may also include Figure 6 For components not shown, reference may be made to the prior art.

[0110] like Figure 6 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0111] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0112] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0113] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0114] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0115] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0116] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0117] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all steps of the scheduled task diagnosis method in the above embodiment, wherein the execution subject may be a server, and a computer program is stored on the computer-readable storage medium, which implements all steps of the scheduled task diagnosis method in the above embodiment when executed by a processor.

[0118] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0119] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0122] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A timed task diagnosis method, characterized in that: include: Collect scheduled task execution logs generated by multiple servers; Diagnose the scheduled tasks executed by each server according to each scheduled task execution log and generate scheduled task diagnosis results; The method further includes: performing a batch configuration operation on the scheduled tasks, wherein the batch configuration operation includes: Check whether the user's crontab permissions exist. If it exists, check whether the user has the original crontab task; if it does not exist, grant the execution user the crontab permission, and then check whether the user has the original crontab task; If it exists, write the original crontab task to the temporary file; if it does not exist, add an empty temporary file and check whether to add or modify the crontab task; If a new crontab task is added, the task list is appended to the temporary file to make the crontab task effective; if a crontab task is modified, the task list is modified to the temporary file to make the crontab task effective.

2. The timed task diagnosis method according to claim 1, characterized in that: Before the scheduled task is executed by the corresponding server, at least one of the following steps is also included: Check whether the server has a scheduled task program; Check whether the scheduled task background process is started; Check the time zone of the scheduled task; Check the environment variables of the scheduled task execution environment; Check whether the scheduled task period complies with the scheduled task format standard.

3. The timed task diagnosis method according to claim 1, characterized in that: The scheduled task diagnosis result includes the error content of the log. The scheduled tasks executed by each server are diagnosed according to each scheduled task execution log to generate the scheduled task diagnosis result, including: Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

4. The timed task diagnosis method according to claim 3, characterized in that: Also includes: Generate a prompt statement according to the error content; The prompt statements are sent to each server accordingly.

5. The timed task diagnosis method according to claim 1, characterized in that: If the scheduled task execution log is not received within the set time period, check whether the start time point set for the scheduled task is consistent with the actual execution time point. If not, re-set the start time point of the scheduled task.

6. A timed task diagnostic device, characterized in that: include: The collection module collects the scheduled task execution logs generated by multiple servers; The diagnostic module diagnoses the scheduled tasks executed by each server according to the execution log of each scheduled task and generates the scheduled task diagnosis results; The device is further configured to: perform a batch configuration operation on the scheduled tasks, wherein the batch configuration operation includes: Check whether the user's crontab permissions exist. If it exists, check whether the user has the original crontab task; if it does not exist, grant the execution user the crontab permission, and then check whether the user has the original crontab task; If it exists, write the original crontab task to the temporary file; if it does not exist, add an empty temporary file and check whether to add or modify the crontab task; If a new crontab task is added, the task list is appended to the temporary file to make the crontab task effective; if a crontab task is modified, the task list is modified to the temporary file to make the crontab task effective.

7. The timed task diagnostic device according to claim 6, characterized in that: The invention also includes an inspection module, wherein the inspection module includes at least one of the following units: Scheduled task program checking unit, checking whether the server has a scheduled task program; The background startup check unit checks whether the scheduled task background process is started; Time zone checking unit, checks the time zone of scheduled tasks; Environment variable checking unit, checks the environment variables of the scheduled task execution environment; The format checking unit checks whether the scheduled task cycle complies with the scheduled task format standard.

8. The timed task diagnostic device according to claim 6, characterized in that: The diagnostic module comprises: Search for keywords in the scheduled task execution log, and determine the error content in each scheduled task execution log according to the correspondence between the predefined keywords and the error content.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the scheduled task diagnosis method according to any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the timing task diagnosis method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Server diagnosis method, device and system

    CN107018023A

  • Power supply fault diagnosis method, device and server

    CN109240846A

  • Remote log acquisition method and system based on Linux periodic command

    CN109271271A

  • Diagnostic data transmission method, device, equipment and system

    CN110912992A

  • Cluster crontab batch updating method, apparatus and device and medium

    CN110955443A