CN112000372A - Method and system for executing command in Linux system - Google Patents

Method and system for executing command in Linux system Download PDF

Info

Publication number
CN112000372A
CN112000372A CN202010854350.XA CN202010854350A CN112000372A CN 112000372 A CN112000372 A CN 112000372A CN 202010854350 A CN202010854350 A CN 202010854350A CN 112000372 A CN112000372 A CN 112000372A
Authority
CN
China
Prior art keywords
command
script
file
target
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010854350.XA
Other languages
Chinese (zh)
Inventor
刘德建
何巍巍
林清福
陈宏展
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianqing Online Interactive Technology Co Ltd
Original Assignee
Fujian Tianqing Online Interactive Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianqing Online Interactive Technology Co Ltd filed Critical Fujian Tianqing Online Interactive Technology Co Ltd
Priority to CN202010854350.XA priority Critical patent/CN112000372A/en
Publication of CN112000372A publication Critical patent/CN112000372A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3867Concurrent instruction execution, e.g. pipeline, look ahead using instruction pipelines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method for executing commands in a Linux system, which comprises the following steps: step S1, storing the command content, the target IP of the target server and the storage path information of the script file into a command file, and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on a distribution server; step S2, the central control server deployed in the Windows system acquires the command file from the distribution server, analyzes the script command in the command file, and sends the script command to the target server deployed in the Linux system; step S3, the target server receives and executes the script command, sends the execution result information to the central control server, and waits for the next script command; step S4, the central control server sends the script command execution result to the client; and step S5, the client displays the main information of the script command executing process, wherein the main information comprises command starting executing information and command executing results. The invention improves the working efficiency of the user and ensures the accuracy of the executed command.

Description

Method and system for executing command in Linux system
Technical Field
The invention relates to the technical field of computer communication, in particular to a method and a system for executing commands in a Linux system.
Background
The Linux command is a command for managing the Linux system, and is important in the Linux system, and all operations can be completed through the Linux command; because the efficiency of inputting commands is low, the time is relatively consumed (particularly, some functions are formed by a plurality of commands), most people adopt an optimization scheme that the commands required by the functions are combined in a shell script, and when a certain function needs to be operated, the user logs in a server to execute the corresponding script, so that the efficiency can be improved to a certain extent; for the case that the number of shell scripts is small and the number of Linux servers is small, the scheme is acceptable, but if the number of operating Linux servers is large or the number of shell scripts is large, the overall efficiency is low due to the need of manual operation, and the overall efficiency is not greatly improved.
Disclosure of Invention
In order to overcome the above problems, an object of the present invention is to provide a method for executing commands in a Linux system, which ensures the accuracy of executing commands.
The invention is realized by adopting the following scheme: a method for executing commands in a Linux system comprises the following steps:
step S1, storing the command content, the target IP of the target server and the storage path information of the script file into a command file, and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on a distribution server;
step S2, the central control server deployed in the Windows system acquires the command file from the distribution server, analyzes the script command in the command file, and sends the script command to the target server deployed in the Linux system;
step S3, the target server receives and executes the script command, sends the execution result information to the central control server, and waits for the next script command;
step S4, the central control server sends the script command execution result to the client;
and step S5, the client displays the main information of the script command executing process, wherein the main information comprises a command to start executing and a command executing result.
Further, the step S2 is further specifically: the central control server acquires a command file from the distribution server by using an ftp protocol, analyzes script commands in the command file and a target IP (Internet protocol) of a target server to execute the script commands, and circularly transmits script command information to the target server according to the execution sequence of the script commands; the step S4 further includes: and the central control server sends the execution result of the script command to the client, judges the operation of the subsequent command according to the execution result of the script command, if the execution of the script command is successful, continues to send the next script command for execution, and if the execution of the script command fails, suspends the execution of the script command and waits for manual intervention.
Further, the content format of the command file is: command file name + target IP of multiple target servers + script file storage path + multiple script commands.
The invention provides a system for executing commands in a Linux system, which comprises a command file forming module, a central control module, a command executing module and a client display module;
the command file forming module is used for storing the command content, the target IP of the target server and the storage path information of the script file into a command file and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on the distribution server;
the central control module is used for acquiring the command file from the distribution server under the Windows system, analyzing the script command in the command file, then sending the script command to the target server and sending the command execution result received from the target server to the client;
the command execution module receives and executes the script command through the target server, sends execution result information to the central control module and waits for the next script command;
the client displays the main information of the script command execution process, wherein the main information comprises command starting execution information and a command execution result.
Further, the implementation manner of the central control module is further specifically: acquiring a command file from a distribution server by using an ftp protocol, analyzing script commands in the command file and a target IP of a target server to execute the script commands, circularly transmitting script command information to the target server according to the execution sequence of the script commands, after the target server feeds back the execution result of the script commands, judging the operation of subsequent commands according to the feedback result of the execution command, if the script commands are successfully executed, continuously transmitting the next script command for execution, and if the script commands are unsuccessfully executed, suspending the execution of the script commands and waiting for manual intervention.
Further, the content format of the command file is: command file name + target IP of multiple target servers + script file storage path + multiple script commands.
The invention has the beneficial effects that: the invention saves the command content, the target IP of the target server and the storage path information of the script file into a command file, and analyzes the script command in the command file by acquiring the command file from the distribution server; the script command is received and executed by the command execution module under the target server, and the execution result information is sent to the client, so that the operations of executing the command and brushing the shell script under linux are facilitated, the working efficiency of a user is improved, and the accuracy of executing the command is ensured.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Fig. 2 is a schematic block diagram of the system of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, a method for executing commands in a Linux system according to the present invention includes the following steps:
step S1, storing the command content, the target IP of the target server and the storage path information of the script file into a command file, and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on a distribution server;
step S2, the central control server deployed in the Windows system acquires the command file from the distribution server, analyzes the script command in the command file, and sends the script command to the target server deployed in the Linux system;
step S3, the target server receives and executes the script command, sends the execution result information to the central control server, and waits for the next script command;
step S4, the central control server sends the script command execution result to the client;
in step S5, the client displays the main information of the script command execution process, where the main information includes the start execution command and the command execution result (execution success or execution failure).
In the present invention, the step S2 further includes: the central control server acquires the command file from the distribution server by using an ftp protocol, then parses the script command in the command file and the target IP of the target server to be executed with the script command, and circularly sends the script command information to the target server according to the execution sequence of each script command, wherein the step S4 is further specifically: and the central control server sends the execution result of the script command to the client, judges the operation of the subsequent command according to the execution result of the script command, if the execution of the script command is successful, continues to send the next script command for execution, and if the execution of the script command fails, suspends the execution of the script command and waits for manual intervention.
The content format of the command file is as follows: command file name + target IP of multiple target servers + script file storage path + multiple script commands. See specifically below:
[ Filedname ]// Module name has no special meaning to ensure uniqueness
IP1= XXX.XXX.XXX.XXX// target IP of target server
IP2=XXX.XXX.XXX.XXX
IPn=XXX.XXX.XXX.XXX
PATH =/XXX// script file storage PATH information
CMD1= xxx 1// specific script command or script content
CMD2=xxx2
CMD3=xxx3。
Referring to fig. 2, the present invention provides a system for executing commands in a Linux system, where the system includes a command file forming module, a central control module, a command executing module, and a client presentation module;
the command file forming module is used for storing the command content, the target IP of the target server and the storage path information of the script file into a command file and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on the distribution server;
the central control module is used for acquiring the command file from the distribution server under the Windows system, analyzing the script command in the command file, then sending the script command to the target server and sending the command execution result received from the target server to the client;
the command execution module receives and executes the script command through the target server, sends execution result information to the central control module and waits for the next script command;
the client displays the main information of the script command execution process, wherein the main information comprises command starting execution information and a command execution result.
The invention is further illustrated below with reference to a specific embodiment:
a system for executing commands in a Linux system comprises a command file forming module, a central control module, a command executing module and a client display module;
the command file forming module stores the command content, the target IP of the server where the command execution module is located and the storage path of the script file into a file, called a command file, and stores the command file into an FTP account directory on a distribution server.
The central control module acquires the command file from the distribution server, and analyzes the command content, the ip of the command execution module server and the script file storage path in the command file.
The command execution module receives the command sent by the execution central control module, sends result information (success or failure) to the central control module, and then waits for the next command.
And the central control module feeds back the received result to the client and judges the subsequent command operation flow according to the result information.
And the client display module displays main information of the command execution process through the client, wherein the main information comprises a command starting execution, a command execution result and the like.
Wherein, the client: and main information of the command execution process sent by the central control module is received and displayed, so that a manager can conveniently check the command execution condition.
A central control module: the method comprises the steps that a core module and a command scheduling center of the technology acquire a command file from a distribution server by utilizing an ftp protocol, then command content, target IP of a server where a command execution module is located and script file storage path information are analyzed according to the content format of the command file, command information is circularly sent to the command execution module deployed on a target server according to the execution sequence of each command, then feedback of the command execution module is waited, then feedback information is sent to a client, meanwhile, the operation of a subsequent command is judged according to the feedback result of the command execution module, if the command execution is successful, the next command is continuously sent to the command execution module, if the command execution is failed, the command is paused, and manual intervention is waited.
A command execution module: the system is deployed on a server for executing the command, is used for receiving the command sent by the central control, and reports an execution result (success or failure) to the central control module after the execution is finished.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.

Claims (6)

1. A method for executing commands in a Linux system is characterized in that: the method comprises the following steps:
step S1, storing the command content, the target IP of the target server and the storage path information of the script file into a command file, and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on a distribution server;
step S2, the central control server deployed in the Windows system acquires the command file from the distribution server, analyzes the script command in the command file, and sends the script command to the target server deployed in the Linux system;
step S3, the target server receives and executes the script command, sends the execution result information to the central control server, and waits for the next script command;
step S4, the central control server sends the script command execution result to the client;
and step S5, the client displays the main information of the script command executing process, wherein the main information comprises command starting executing information and command executing results.
2. The method for executing commands in the Linux system according to claim 1, wherein: the step S2 further includes: the central control server acquires a command file from the distribution server by using an ftp protocol, analyzes script commands in the command file and a target IP (Internet protocol) of a target server to execute the script commands, and circularly transmits script command information to the target server according to the execution sequence of the script commands; the step S4 further includes: and the central control server sends the execution result of the script command to the client, judges the operation result of the subsequent command according to the execution result of the script command, if the execution of the script command is successful, continues to send the next script command for execution, and if the execution of the script command fails, suspends the execution of the script command and waits for manual intervention.
3. The method for executing commands in the Linux system according to claim 1, wherein: the content format of the command file is as follows: command file name + target IP of multiple target servers + script file storage path + multiple script commands.
4. A system for executing commands under a Linux system is characterized in that: the system comprises a command file forming module, a central control module, a command execution module and a client display module;
the command file forming module is used for storing the command content, the target IP of the target server and the storage path information of the script file into a command file and storing the command content, the target IP of the target server and the storage path information of the script file into an FTP account directory on the distribution server;
the central control module is used for acquiring the command file from the distribution server under the Windows system, analyzing the script command in the command file, then sending the script command to the target server and sending the command execution result received from the target server to the client;
the command execution module receives and executes the script command through the target server, sends execution result information to the central control module and waits for the next script command;
the client displays the main information of the script command execution process, wherein the main information comprises command starting execution information and a command execution result.
5. The system according to claim 1, wherein the command executing system comprises: the implementation manner of the central control module is further specifically as follows: acquiring a command file from a distribution server by using an ftp protocol, analyzing script commands in the command file and a target IP of a target server to execute the script commands, circularly transmitting script command information to the target server according to the execution sequence of the script commands, after the target server feeds back the execution result of the script commands, judging the operation of subsequent commands according to the feedback result of the execution command, if the script commands are successfully executed, continuously transmitting the next script command for execution, and if the script commands are unsuccessfully executed, suspending the execution of the script commands and waiting for manual intervention.
6. The system according to claim 1, wherein the command executing system comprises: the content format of the command file is as follows: command file name + target IP of multiple target servers + script file storage path + multiple script commands.
CN202010854350.XA 2020-08-24 2020-08-24 Method and system for executing command in Linux system Pending CN112000372A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010854350.XA CN112000372A (en) 2020-08-24 2020-08-24 Method and system for executing command in Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010854350.XA CN112000372A (en) 2020-08-24 2020-08-24 Method and system for executing command in Linux system

Publications (1)

Publication Number Publication Date
CN112000372A true CN112000372A (en) 2020-11-27

Family

ID=73473130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010854350.XA Pending CN112000372A (en) 2020-08-24 2020-08-24 Method and system for executing command in Linux system

Country Status (1)

Country Link
CN (1) CN112000372A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579101A (en) * 2020-12-21 2021-03-30 广州博冠信息科技有限公司 Task script control method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170568A (en) * 2007-11-29 2008-04-30 中兴通讯股份有限公司 A method for automatically generating and executing Telnet command via batch mode
KR20130033201A (en) * 2011-09-26 2013-04-03 한국전자통신연구원 Method for controlling and testing target system using script file
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports
CN106789205A (en) * 2016-12-09 2017-05-31 广州视源电子科技股份有限公司 Group of planes order operation method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170568A (en) * 2007-11-29 2008-04-30 中兴通讯股份有限公司 A method for automatically generating and executing Telnet command via batch mode
KR20130033201A (en) * 2011-09-26 2013-04-03 한국전자통신연구원 Method for controlling and testing target system using script file
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports
CN106789205A (en) * 2016-12-09 2017-05-31 广州视源电子科技股份有限公司 Group of planes order operation method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579101A (en) * 2020-12-21 2021-03-30 广州博冠信息科技有限公司 Task script control method and device, electronic equipment and storage medium
CN112579101B (en) * 2020-12-21 2023-07-18 广州博冠信息科技有限公司 Task script management and control method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107704395B (en) Cloud platform automation test implementation method and system based on Openstack
US8863085B1 (en) Monitoring web applications
CN111176858A (en) Data request processing method and device
CN111460356B (en) Automatic login method, device, medium and equipment
CN110224896B (en) Network performance data acquisition method and device and storage medium
CN111143207B (en) Method for checking model training notice and training log at mobile terminal
US11838381B2 (en) Device cross-area access method, electronic device, and non-transitory computer-readable storage medium
CN107911467B (en) Service operation management system and method for scripted operation
CN111414208A (en) Application program starting method, device and equipment
CN115686540B (en) RPA control method and system based on Hongmong system
CN112000372A (en) Method and system for executing command in Linux system
CN107515761B (en) Method and equipment for hot upgrading of virtual machine management service module
CN111159019A (en) Application program testing method, testing control terminal and testing terminal
CN114844814A (en) Pressure testing method and device
CN111930625B (en) Log acquisition method, device and system based on cloud service platform
CN111258902B (en) Performance test method and performance test system based on SockJS server
US11144370B2 (en) Communication method for virtual machines, electronic device, and non-transitory computer readable storage medium
CN101582890B (en) Method and system for realizing connection between X11 client and X11 server
CN110309391A (en) Scheduling, processing method, device, storage medium and the equipment of content crawl task
CN114610446A (en) Method, device and system for automatically injecting probe
CN109889579B (en) General upgrading system under cloud computing environment
CN114691486A (en) Program debugging method and device and computer equipment
CN112416641A (en) Controlled end node restart detection method in master-slave architecture and master control end node
CN110266762A (en) A kind of data uploading method, system, device and storage medium
CN112737760B (en) Method and system for duplex data communication based on pipeline communication technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination