[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

JP2018063496A - GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE - Google Patents

GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE Download PDF

Info

Publication number
JP2018063496A
JP2018063496A JP2016200451A JP2016200451A JP2018063496A JP 2018063496 A JP2018063496 A JP 2018063496A JP 2016200451 A JP2016200451 A JP 2016200451A JP 2016200451 A JP2016200451 A JP 2016200451A JP 2018063496 A JP2018063496 A JP 2018063496A
Authority
JP
Japan
Prior art keywords
command
argument
execution
variable
commands
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
JP2016200451A
Other languages
Japanese (ja)
Inventor
えり子 得能
Eriko Tokuno
えり子 得能
文彦 福島
Fumihiko Fukushima
文彦 福島
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2016200451A priority Critical patent/JP2018063496A/en
Publication of JP2018063496A publication Critical patent/JP2018063496A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

【課題】管理者による作業効率の向上を図ること。【解決手段】生成装置100は、コマンドと、コマンドに対応付けて入力された引数と、を含む実行履歴が記憶されたコマンド実行ログ101を取得する。生成装置100は、コマンドリスト102を参照して、取得したコマンド実行ログ101から、実行履歴におけるコマンド「deploy」と引数「Server01」とを特定する。生成装置100は、特定したコマンド「deploy」と、特定した引数「Server01」を置き換えた変数「$SERVER01」と、に基づいて、シェルスクリプト103を生成する。【選択図】図1[PROBLEMS] To improve work efficiency by an administrator. A generation apparatus acquires a command execution log in which an execution history including a command and an argument input in association with the command is stored. The generation apparatus 100 refers to the command list 102 and identifies the command “delay” and the argument “Server01” in the execution history from the acquired command execution log 101. The generation apparatus 100 generates the shell script 103 based on the specified command “deploy” and the variable “$ SERVER01” obtained by replacing the specified argument “Server01”. [Selection] Figure 1

Description

本発明は、生成プログラム、生成方法、および生成装置に関する。   The present invention relates to a generation program, a generation method, and a generation apparatus.

従来、サーバの管理者は、サーバへのコマンドの入力によってサーバに対して所望の作業を行う場合がある。また、管理者は、例えば、複数のコマンドをまとめたシェルスクリプトを作成することにより複数のコマンドをサーバに一括実行させることができる。シェルスクリプトにより、管理者は、作業を繰り返し行う際のコマンド入力の手間を省くことができる。また、例えば、1回または数回のように繰り返し行われない作業の場合、管理者は、シェルスクリプトの作成に手間がかかるため、シェルスクリプトを作成せずにコマンドを順に入力することにより作業を行う。   Conventionally, a server administrator may perform a desired operation on a server by inputting a command to the server. Further, the administrator can cause the server to execute a plurality of commands at once by creating a shell script in which a plurality of commands are collected, for example. With the shell script, the administrator can save the trouble of inputting a command when repeatedly performing the work. Also, for example, in the case of work that is not repeatedly performed, such as once or several times, the administrator takes time to create a shell script, so the work is performed by inputting commands in order without creating a shell script. Do.

先行技術としては、例えば、操作ログファイルと、操作ログファイルから取得した操作ログについての実行用コマンドと実行用コマンドに応答したコンピュータでの出力内容とを解析および編集することにより操作ドキュメントを自動生成する技術がある。   As a prior art, for example, an operation document is automatically generated by analyzing and editing an operation log file, an execution command for the operation log acquired from the operation log file, and a computer output in response to the execution command. There is technology to do.

特開2012−93996号公報JP 2012-93996 A

しかしながら、1回または数回しか行わない予定のため、管理者が、シェルスクリプトを作成せずにコマンドを順に入力してコマンドをサーバに実行させることにより作業を行った後に、同様の作業を繰り返し行うようになる場合がある。このような場合、管理者は、例えば、同様のコマンド入力を繰り返して行うなど、作業を効率よく行うことができないという問題点がある。   However, because it is scheduled to be performed only once or several times, the administrator repeats the same work after performing the work by inputting the commands in order without causing the shell script to be created and causing the server to execute the commands. May come to do. In such a case, there is a problem that the administrator cannot perform the work efficiently, for example, by repeatedly performing the same command input.

1つの側面では、本発明は、管理者による作業効率の向上を図ることができる生成プログラム、生成方法、および生成装置を提供することを目的とする。   In one aspect, an object of the present invention is to provide a generation program, a generation method, and a generation apparatus capable of improving work efficiency by an administrator.

本発明の一側面によれば、コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する生成プログラム、生成方法、および生成装置が提案される。   According to one aspect of the present invention, a command execution log storing an execution history including a command and an argument associated with the command is acquired, and the acquired command is referred to a command list storing the command. The command and the argument in the execution history are specified from the execution log, and the command is set with the value set in the variable as an argument based on the specified command and the variable replacing the specified argument. A generation program, a generation method, and a generation apparatus for generating an executable program are proposed.

本発明の一態様によれば、管理者による作業効率の向上を図ることができる。   According to one embodiment of the present invention, it is possible to improve work efficiency by an administrator.

図1は、本発明にかかる生成装置による一動作例を示す説明図である。FIG. 1 is an explanatory diagram showing an example of the operation of the generation apparatus according to the present invention. 図2は、生成装置のハードウェア構成例を示す説明図である。FIG. 2 is an explanatory diagram illustrating a hardware configuration example of the generation device. 図3は、生成装置の機能的構成例を示すブロック図である。FIG. 3 is a block diagram illustrating a functional configuration example of the generation device. 図4は、コマンド実行ログ例を示す説明図である。FIG. 4 is an explanatory diagram illustrating an example of a command execution log. 図5は、コマンドリスト例を示す説明図である。FIG. 5 is an explanatory diagram illustrating an example of a command list. 図6は、テンプレートファイル例を示す説明図である。FIG. 6 is an explanatory diagram illustrating an example of a template file. 図7は、実行部分の抽出例を示す説明図である。FIG. 7 is an explanatory diagram of an example of extracting an execution part. 図8は、シェルスクリプト例を示す説明図である。FIG. 8 is an explanatory diagram illustrating an example of a shell script. 図9は、オプション情報例を示す説明図である。FIG. 9 is an explanatory diagram illustrating an example of option information. 図10は、生成装置による生成処理手順例を示すフローチャート(その1)である。FIG. 10 is a flowchart (part 1) illustrating an example of a generation processing procedure by the generation device. 図11は、生成装置による生成処理手順例を示すフローチャート(その2)である。FIG. 11 is a flowchart (part 2) illustrating an example of a generation processing procedure by the generation device.

以下に添付図面を参照して、本発明にかかる生成プログラム、生成方法、および生成装置の実施の形態を詳細に説明する。   Exemplary embodiments of a generation program, a generation method, and a generation apparatus according to the present invention will be described below in detail with reference to the accompanying drawings.

図1は、本発明にかかる生成装置による一動作例を示す説明図である。生成装置100は、サーバの管理者が行うコマンド実行による作業を支援するコンピュータである。生成装置100は、管理者による管理対象のサーバそのものであってもよいし、管理対象のサーバを制御可能な装置や管理対象のサーバと通信可能な装置であってもよい。   FIG. 1 is an explanatory diagram showing an example of the operation of the generation apparatus according to the present invention. The generation apparatus 100 is a computer that supports work by command execution performed by a server administrator. The generation device 100 may be a server itself managed by an administrator, a device that can control the management target server, or a device that can communicate with the management target server.

ここで、コマンドとは、コンピュータに指示する特定の文字列である。コマンドを実行するとは、コマンドによって定められた処理を管理対象のサーバなどのコンピュータが実行することである。引数は、コマンドの動作を決定するためにコマンドに付加される数値や文字である。また、引数は、例えば、コマンドの実行に使用されるファイル名や出力されるメッセージなどを指定するためにコマンドに付加される数値や文字である。引数は、コマンドに対応付けて入力される。例えば、引数は、「コマンド 引数」のようにコマンドにつづいてスペース区切りで入力される。また、引数が複数ある場合、各引数は、「コマンド 引数 引数」のようにスペース区切りで入力される。ここで、コマンドの動作を決定するための数値や文字である引数については、オプションとも称する。   Here, the command is a specific character string for instructing the computer. Executing a command means that a computer such as a management target server executes a process defined by the command. The argument is a numerical value or a character added to the command to determine the operation of the command. The argument is, for example, a numerical value or a character added to the command in order to specify a file name used for executing the command or an output message. The argument is input in association with the command. For example, arguments are input by separating each command with a space, such as “command argument”. Also, if there are multiple arguments, each argument is entered separated by a space as in “Command argument argument”. Here, an argument that is a numerical value or a character for determining the operation of the command is also referred to as an option.

従来、サーバの管理者は、サーバへのコマンドの入力によってサーバに対して所望の作業を行う場合がある。また、管理者は、例えば、複数のコマンドをまとめたシェルスクリプトを作成することにより複数のコマンドをサーバに一括実行させることができる。シェルスクリプトにより、管理者は、作業を繰り返し行う際のコマンド入力の手間を省くことができる。例えば、ネットワークを通じて提供されるWebアプリケーションをサーバ上で利用可能な状態にするために、管理者は、Webアプリケーションに関するファイルをサーバ上に展開するような作業を繰り返し行う。このような場合に、管理者は、例えば、ファイルをサーバ上に展開するための複数のコマンドをまとめたシェルスクリプトを作成する。そして、管理者は、シェルスクリプトの実行時にファイル名の指定を変更して複数のファイルの各々を順位サーバ上に展開することができる。   Conventionally, a server administrator may perform a desired operation on a server by inputting a command to the server. Further, the administrator can cause the server to execute a plurality of commands at once by creating a shell script in which a plurality of commands are collected, for example. With the shell script, the administrator can save the trouble of inputting a command when repeatedly performing the work. For example, in order to make a Web application provided through the network available on the server, the administrator repeatedly performs a task of developing a file related to the Web application on the server. In such a case, for example, the administrator creates a shell script in which a plurality of commands for expanding the file on the server are collected. Then, the administrator can change the designation of the file name when executing the shell script and deploy each of the plurality of files on the ranking server.

また、シェルスクリプトの作成に手間がかかるため、1回または数回のように繰り返さないような作業の場合、管理者は、シェルスクリプトを作成せずにコマンドを順に入力することにより作業を行う。   In addition, since it takes time to create a shell script, in the case of work that is not repeated once or several times, the administrator performs work by inputting commands in order without creating a shell script.

しかしながら、1回または数回しか行わない予定のため、管理者がシェルスクリプトを作成せずにコマンドを順に入力することにより作業を行った後に、同様の作業を繰り返し行うようになる場合がある。このような場合、管理者は、例えば、同様のコマンド入力を繰り返して行うなど、作業を効率よく行うことができないという問題点がある。   However, since it is scheduled to be performed only once or several times, there is a case where the same operation is repeatedly performed after the administrator performs the operation by sequentially inputting commands without creating a shell script. In such a case, there is a problem that the administrator cannot perform the work efficiently, for example, by repeatedly performing the same command input.

そこで、本実施の形態では、生成装置100は、コマンドリスト102を参照してコマンド実行ログ101内の実行履歴におけるコマンドと引数とを特定し、コマンドと引数を置換した変数とに基づきシェルスクリプト103を生成する。これにより、生成装置100は、管理者によって繰り返し行われる作業の効率化を図る。管理者は、変数に新たな引数の値を与えてシェルスクリプト103を管理対象のサーバに実行させるだけで同様の作業を繰り返し行うことができる。したがって、生成装置100は、管理者の作業の効率化を図ることができる。作業の効率化としては、例えば、管理者が何度もコマンドを入力する手間を省くことが挙げられる。   Therefore, in the present embodiment, the generation apparatus 100 refers to the command list 102, identifies the command and argument in the execution history in the command execution log 101, and based on the command and the variable with the argument replaced, the shell script 103. Is generated. As a result, the generation apparatus 100 increases the efficiency of work repeatedly performed by the administrator. The administrator can repeatedly perform the same operation only by giving a new argument value to the variable and causing the server to be managed to execute the shell script 103. Therefore, the generation device 100 can improve the efficiency of the administrator's work. As an example of improving work efficiency, for example, it is possible to save the administrator from inputting a command many times.

まず、生成装置100は、コマンド実行ログ101を取得する。コマンド実行ログ101は、コマンドとコマンドに対応付けて入力された引数とを含む実行履歴が記憶される。コマンド実行ログ101に含まれる実行履歴は、管理者の操作入力により実行されたコマンドや、過去に自動実行されたコマンドの実行履歴である。図1の例では、コマンド実行ログ101は、1つのコマンドに関するログであるが、これに限らず、連続して実行された複数のコマンドが含まれていてもよい。取得方法としては、生成装置100は、例えば、自装置が有する記憶装置から読み出すことによりコマンド実行ログ101を取得してもよいし、外部装置からネットワークなどを介して取得してもよい。   First, the generation device 100 acquires a command execution log 101. The command execution log 101 stores an execution history including a command and an argument input in association with the command. The execution history included in the command execution log 101 is an execution history of a command executed by an operation input by an administrator or a command automatically executed in the past. In the example of FIG. 1, the command execution log 101 is a log related to one command, but is not limited thereto, and may include a plurality of commands executed continuously. As an acquisition method, for example, the generation device 100 may acquire the command execution log 101 by reading from a storage device included in the device itself, or may acquire the command execution log 101 from an external device via a network or the like.

つぎに、生成装置100は、コマンドリスト102を参照して、取得したコマンド実行ログ101から、実行履歴におけるコマンドと引数とを特定する。コマンドリスト102には、コマンドが記憶されてある。図1の例では、コマンドリスト102には、コマンド「deploy」が含まれる。   Next, the generation device 100 refers to the command list 102 and identifies the command and argument in the execution history from the acquired command execution log 101. The command list 102 stores commands. In the example of FIG. 1, the command list 102 includes a command “deploy”.

ここで、実行履歴におけるコマンドと引数とを特定する方法として、2つの方法を例に挙げる。実行部分111は、コマンドと引数とを含む実行履歴の一例である。1つ目の方法としては、生成装置100は、例えば、コマンド実行ログ101から、実行部分111を抽出した後に、コマンドリスト102を参照して、実行部分111に含まれるコマンドと引数とを特定してもよい。例えば、コマンド実行ログ101には、例えば、コマンドの実行に関する時刻を示す文字列が含まれ、この時刻に関する文字列に後続する文字列を実行部分111として抽出するなどのように予め定められた文字列以降を実行部分111として抽出する。コマンドの実行に関する時刻とは、コマンドの実行開始時刻やコマンドの実行終了時刻などが挙げられる。そして、生成装置100は、抽出した実行部分111から、コマンドリスト102に記憶されたコマンドに基づいて、コマンドを特定することによりコマンドに対応付けて入力された引数を特定する。   Here, as a method for specifying a command and an argument in the execution history, two methods are given as examples. The execution part 111 is an example of an execution history including commands and arguments. As a first method, for example, after generating the execution part 111 from the command execution log 101, the generation apparatus 100 refers to the command list 102 and specifies a command and an argument included in the execution part 111. May be. For example, the command execution log 101 includes, for example, a character string indicating a time related to command execution, and a predetermined character such as a character string following the character string related to this time is extracted as the execution part 111. The part after the column is extracted as the execution part 111. The command execution time includes a command execution start time, a command execution end time, and the like. Then, the generation device 100 specifies an argument input in association with the command by specifying the command from the extracted execution part 111 based on the command stored in the command list 102.

また、2つ目の方法としては、生成装置100は、例えば、コマンド実行ログ101から、コマンドリスト102を参照して、コマンドを特定する。そして、生成装置100は、特定したコマンドに基づいて、コマンドにスペース区切りで入力された文字列を引数として特定してもよい。   As a second method, for example, the generation apparatus 100 refers to the command list 102 from the command execution log 101 and identifies a command. Then, the generation device 100 may specify a character string that is input to the command with a space separator as an argument based on the specified command.

図1の例では、生成装置100は、実行部分111におけるコマンド「deploy」と引数「Server01」とを特定する。   In the example of FIG. 1, the generation apparatus 100 specifies the command “deploy” and the argument “Server01” in the execution part 111.

つぎに、生成装置100は、特定したコマンドと、特定した引数を置き換えた変数と、に基づいて、変数に設定される値を引数として特定したコマンドを実行可能なプログラムを生成する。ここで生成されるプログラムは、プログラミング言語の1種であるスクリプト言語で記載されたプログラムであるため、シェルスクリプト103とも称する。シェルスクリプト103の生成方法としては、生成装置100は、シェルスクリプト103の雛形のデータとなるテンプレートファイルに、コマンドと、引数を置き換えた変数と、を含む実行部分を追加することによりシェルスクリプト103を生成してもよい。また、生成装置100は、生成するプログラムとして、テンプレートファイルに、コマンドと、引数を置き換えた変数と、を含む実行部分を追加することにより得られたシェルスクリプトをコンパイルして得られた実行ファイルを生成してもよい。   Next, the generating apparatus 100 generates a program that can execute the command specified by using the value set in the variable as an argument based on the specified command and the variable in which the specified argument is replaced. Since the program generated here is a program written in a script language which is a kind of programming language, it is also referred to as a shell script 103. As a method of generating the shell script 103, the generating apparatus 100 adds the execution part including the command and the variable with the argument replaced to the template file that is the template data of the shell script 103, thereby generating the shell script 103. It may be generated. In addition, the generation apparatus 100 generates an executable file obtained by compiling a shell script obtained by adding an execution part including a command and a variable in which an argument is replaced, as a program to be generated. It may be generated.

ここで、引数を変数に置き換える際に、生成装置100は、値の異なる引数が異なる変数となるように置き換える。また、引数を変数に置き換える際に、生成装置100は、値の同じ引数が同じ変数となるように置き換える。引数を変数に置き換える方法としては、生成装置100は、例えば、引数を、変数であることを示す「$」に変数名を付加させた「$変数名」に置き換える。生成装置100は、例えば、環境変数の命名規則の慣例に従って、引数の値を大文字に変更した文字列を変数名としてもよい。図1の例では、実行部分112は、コマンド「Deploy」と、引数「Server」が置き換えられた変数「$SERVER01」とを含む。そして、生成装置100は、実行部分112を含むシェルスクリプト103を生成する。これにより、管理者は、シェルスクリプト103を参照することにより、引数がどの変数に置き換えられたかが分かる。また、生成装置100は、例えば、特定した引数のうち、上述したオプション以外の引数を変数に置き換えるが、オプションを変数に置き換えなくてもよい。   Here, when replacing the argument with a variable, the generating apparatus 100 replaces the argument having a different value with a different variable. In addition, when replacing the argument with a variable, the generating apparatus 100 replaces the argument having the same value with the same variable. As a method for replacing an argument with a variable, for example, the generating apparatus 100 replaces the argument with “$ variable name” obtained by adding a variable name to “$” indicating that the argument is a variable. The generation device 100 may use, for example, a character string in which the value of an argument is changed to uppercase in accordance with the convention for naming environment variables. In the example of FIG. 1, the execution part 112 includes a command “Deploy” and a variable “$ SERVER01” in which the argument “Server” is replaced. Then, the generation device 100 generates the shell script 103 including the execution part 112. Thereby, the administrator can know which variable the argument is replaced by referring to the shell script 103. Further, for example, the generating apparatus 100 replaces arguments other than the above-described options among the specified arguments with variables, but the options may not be replaced with variables.

また、管理者は、シェルスクリプト103の作成の手間を省くことができる。さらに、管理者は、シェルスクリプト103内の変数に引数の値を与えて管理対象のサーバにシェルスクリプト103を実行させるだけで、管理者は、過去に行った作業を簡単に繰り返すことができる。   In addition, the administrator can save time and labor for creating the shell script 103. Furthermore, the administrator can simply repeat the work performed in the past simply by giving an argument value to the variable in the shell script 103 and causing the server to be managed to execute the shell script 103.

(生成装置100のハードウェア構成例)
図2は、生成装置のハードウェア構成例を示す説明図である。ここでは、生成装置100が、サーバである場合を例に挙げてハードウェア構成を説明するが、生成装置100は、サーバに限らず、PC(Personal Computer)や携帯端末装置であってもよく、特に限定しない。CPU(Central Processing Unit)201と、ROM(Read Only Memory)202と、RAM(Random Access Memory)203と、ディスクドライブ204と、ディスク205と、I/F(Inter/Face)206と、を有する。
(Hardware configuration example of generation device 100)
FIG. 2 is an explanatory diagram illustrating a hardware configuration example of the generation device. Here, the hardware configuration will be described by taking the case where the generation device 100 is a server as an example. However, the generation device 100 is not limited to a server, and may be a PC (Personal Computer) or a mobile terminal device. There is no particular limitation. A CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a RAM (Random Access Memory) 203, a disk drive 204, a disk 205, and an I / F (Inter / Face) 206 are included.

CPU201と、ROM202と、RAM203と、ディスクドライブ204と、I/F206とは、バス200によってそれぞれ接続される。   The CPU 201, ROM 202, RAM 203, disk drive 204, and I / F 206 are connected by a bus 200.

ここで、CPU201は、生成装置100等の全体の制御を司る。ROM202は、各種プログラムを記憶する。ROM202に記憶されるプログラムは、CPU201にロードされることにより、コーディングされている処理をCPU201に実行させる。RAM203はCPU201のワークエリアとして使用される。   Here, the CPU 201 governs overall control of the generation apparatus 100 and the like. The ROM 202 stores various programs. The program stored in the ROM 202 is loaded into the CPU 201 to cause the CPU 201 to execute the coded process. The RAM 203 is used as a work area for the CPU 201.

I/F206は、通信回線を通じてネットワーク207に接続される。そして、I/F206は、ネットワーク207を介して他の装置に接続される。そして、I/F206は、ネットワーク207と内部のインターフェースを司り、他のコンピュータからのデータの入出力を制御する。I/F206には、例えば、モデムやLAN(Local Area Network)アダプタなどを採用することができる。   The I / F 206 is connected to the network 207 through a communication line. The I / F 206 is connected to another device via the network 207. The I / F 206 controls an internal interface with the network 207 and controls data input / output from other computers. For example, a modem or a LAN (Local Area Network) adapter may be employed as the I / F 206.

ディスクドライブ204は、CPU201の制御に従ってディスク205に対するデータのリード/ライトを制御する。ディスク205は、ディスクドライブ204の制御で書き込まれたデータを記憶する。ディスク205としては、例えば、磁気ディスク、光ディスクなどが挙げられる。   The disk drive 204 controls reading / writing of data with respect to the disk 205 according to the control of the CPU 201. The disk 205 stores data written under the control of the disk drive 204. Examples of the disk 205 include a magnetic disk and an optical disk.

また、生成装置100は、上述した構成部のほか、例えば、SSD(Solid State Drive)、キーボードやマウスなどの入力装置、ディスプレイなどの出力装置を有することにしてもよい。   In addition to the components described above, the generation device 100 may include, for example, an SSD (Solid State Drive), an input device such as a keyboard and a mouse, and an output device such as a display.

また、生成装置100は、キーボードやマウスなどの入力装置、ディスプレイなどの出力装置などを有するPCや端末装置とネットワークを介して接続されていてもよい。そして、管理者は、このPCや端末装置に対する操作入力によって生成装置100のコマンドプロンプトに対してコマンド入力を行ってもよい。   The generation apparatus 100 may be connected to a PC or a terminal device having an input device such as a keyboard and a mouse and an output device such as a display via a network. Then, the administrator may input a command to the command prompt of the generation apparatus 100 by an operation input to the PC or terminal device.

また、本実施の形態では、1台のサーバに対して管理者が作業を行うためのシェルスクリプトを作成する例を説明するが、これに限らず、複数のサーバに対して管理者が同様の作業を行うためのシェルスクリプトを作成してもよい。   In this embodiment, an example of creating a shell script for an administrator to perform work for one server will be described. However, the present invention is not limited to this, and the same administrator applies to a plurality of servers. You may create a shell script to do the work.

(生成装置100の機能的構成例)
図3は、生成装置の機能的構成例を示すブロック図である。生成装置100は、取得部301と、抽出部302と、第1生成部303と、第2生成部304と、算出部305と、記憶部310と、を有する。取得部301から算出部305までの制御部300の処理は、例えば、図2に示すCPU201がアクセス可能なROM202、RAM203、ディスク205などの記憶装置に記憶されたプログラムにコーディングされている。そして、CPU201が記憶装置からプログラムを読み出して、プログラムにコーディングされている処理を実行する。これにより、制御部300の処理が実現される。また、制御部300の処理結果は、例えば、ROM202、RAM203、ディスク205などの記憶装置に記憶される。
(Functional configuration example of the generation device 100)
FIG. 3 is a block diagram illustrating a functional configuration example of the generation device. The generation apparatus 100 includes an acquisition unit 301, an extraction unit 302, a first generation unit 303, a second generation unit 304, a calculation unit 305, and a storage unit 310. The processing of the control unit 300 from the acquisition unit 301 to the calculation unit 305 is coded in a program stored in a storage device such as the ROM 202, the RAM 203, and the disk 205 accessible by the CPU 201 shown in FIG. Then, the CPU 201 reads the program from the storage device and executes the process coded in the program. Thereby, the process of the control part 300 is implement | achieved. The processing result of the control unit 300 is stored in a storage device such as the ROM 202, the RAM 203, and the disk 205, for example.

記憶部310は、例えば、ROM202、RAM203、ディスク205などによって実現される。記憶部310は、例えば、コマンド実行ログ311、コマンドリスト312、テンプレートファイル313、コマンドマニュアル情報314などを有する。   The storage unit 310 is realized by, for example, the ROM 202, the RAM 203, the disk 205, and the like. The storage unit 310 includes, for example, a command execution log 311, a command list 312, a template file 313, command manual information 314 and the like.

コマンド実行ログ311は、所定の作業を行うために連続して実行された複数のコマンドのログである。コマンド実行ログ311は、図1に示したコマンド実行ログ101のより詳細な例である。コマンド実行ログ311は、図4に一例を示す。コマンドリスト312は、複数のコマンドのそれぞれについて、コマンドと、コマンドに関するコメント情報と、を対応付けて記憶する。コメント情報とは、コマンドの説明のための文字列であり、コンピュータに指示できない文字列である。コマンドリスト312は、図1に示したコマンドリスト102のより詳細な例である。コマンドリスト312は、図5に一例を示す。   The command execution log 311 is a log of a plurality of commands executed continuously for performing a predetermined work. The command execution log 311 is a more detailed example of the command execution log 101 shown in FIG. An example of the command execution log 311 is shown in FIG. The command list 312 stores a command and comment information regarding the command in association with each other for each of the plurality of commands. The comment information is a character string for explaining the command, and is a character string that cannot be instructed to the computer. The command list 312 is a more detailed example of the command list 102 shown in FIG. An example of the command list 312 is shown in FIG.

テンプレートファイル313は、生成されるシェルスクリプトのテンプレートである。テンプレートファイル313は、図6に一例を示す。コマンドマニュアル情報は、コマンドごとに、コマンドに付加可能なオプションを示す。生成装置100は、コマンドマニュアル情報を用いて、コマンドに対応付けられた引数を、オプションと、オプション以外の引数とに区別させることができる。   The template file 313 is a generated shell script template. An example of the template file 313 is shown in FIG. The command manual information indicates options that can be added to the command for each command. Using the command manual information, the generation apparatus 100 can distinguish the argument associated with the command into an option and an argument other than the option.

図4は、コマンド実行ログ例を示す説明図である。コマンド実行ログ311は、所定の作業を行うために実行されたコマンドのログである。コマンド実行ログ311は、例えば、生成装置100が実行したコマンドのログであってもよいし、他の装置が実行したコマンドのログであってもよい。   FIG. 4 is an explanatory diagram illustrating an example of a command execution log. The command execution log 311 is a log of commands executed to perform a predetermined work. The command execution log 311 may be, for example, a log of commands executed by the generation apparatus 100 or a log of commands executed by other apparatuses.

コマンド実行ログ311には、実行されたコマンドごとに、コマンドの実行開始時刻を示す文字列およびコマンドを含む行と、コマンドの実行終了時刻を示す文字列およびコマンドを含む行と、が含まれる。ここで、日時や時刻を示す文字列をタイムスタンプと称する。コマンドの実行開始時刻を示す文字列は、開始タイムスタンプと称する。コマンドの実行終了時刻を示す文字列は、終了タイムスタンプと称する。ここで、タイムスタンプの後ろに、「START」が付加されていれば、タイムスタンプは、開始タイムスタンプである。また、タイムスタンプの後ろに、「END」が付加されていれば、タイムスタンプは、終了タイムスタンプである。   The command execution log 311 includes, for each executed command, a line including a character string indicating the execution start time of the command and a command, and a line including a character string indicating the execution end time of the command and the command. Here, a character string indicating the date and time is referred to as a time stamp. A character string indicating the command execution start time is referred to as a start time stamp. A character string indicating the execution end time of the command is referred to as an end time stamp. Here, if “START” is added after the time stamp, the time stamp is the start time stamp. If “END” is added after the time stamp, the time stamp is the end time stamp.

コマンド実行ログ311は、コマンドの実行順に実行履歴が並べられてある。図4の例では、コマンド実行ログ311は22行ある。コマンド実行ログ311の奇数行には、開始タイムスタンプおよびコマンドを含む行が含まれる。コマンド実行ログ311の偶数行には、終了タイムスタンプおよびコマンドを含む行が含まれる。   The command execution log 311 has an execution history arranged in the order of command execution. In the example of FIG. 4, the command execution log 311 has 22 rows. The odd lines of the command execution log 311 include a line including the start time stamp and the command. The even lines of the command execution log 311 include a line including the end time stamp and the command.

図5は、コマンドリスト例を示す説明図である。コマンドリスト312は、各コマンドと、各コマンドに関するコメント情報とを対応付けて記憶する。コマンドリスト312には、コマンド、シェル用コメント情報、オプション用コメント情報のフィールドを有する。コマンドリスト312は、各フィールドに情報が設定されることにより、レコード(例えば、500−1〜500−6)などが記憶される。   FIG. 5 is an explanatory diagram illustrating an example of a command list. The command list 312 stores each command and comment information related to each command in association with each other. The command list 312 includes fields for command, shell comment information, and option comment information. The command list 312 stores records (for example, 500-1 to 500-6) by setting information in each field.

コマンドのフィールドには、サーバで使用可能なコマンドが設定される。シェル用コメント情報のフィールドには、生成されるシェルスクリプトにおいて、コマンドに対応付けられるコマンドに関するコメント情報が設定される。シェル用コメント情報は、生成されるシェルスクリプトにおいてコマンドに対応付けられるコメント情報である。オプション用コメント情報のフィールドには、生成されるオプション情報において、コマンド実行ログ311内でコマンドに付加された引数に対応付けられるコメント情報である。   Commands usable in the server are set in the command field. In the shell comment information field, comment information related to the command associated with the command in the generated shell script is set. The comment information for shell is comment information associated with the command in the generated shell script. The option comment information field is comment information associated with an argument added to the command in the command execution log 311 in the generated option information.

レコード500−2には、コマンドとして「create−cluster」が設定され、シェル用コメント情報として「クラスタの作成」が設定され、オプション用コメント情報として「クラスタを作成」が設定される。   In the record 500-2, “create-cluster” is set as the command, “create cluster” is set as the comment information for shell, and “create cluster” is set as the comment information for option.

図6は、テンプレートファイル例を示す説明図である。テンプレートファイル313は、シェルスクリプトを作成する上で雛形となるデータである。   FIG. 6 is an explanatory diagram illustrating an example of a template file. The template file 313 is data that serves as a template for creating a shell script.

テンプレートファイル313の2行目には、生成されるオプション情報を呼び出すための命令文が含まれる。2行目の「optioninfo」は後述するオプション情報のファイル名である。オプション情報のファイル名を予め決めておくことにより、テンプレートファイル313からシェルスクリプトを生成する際の変更が少なくなる。これにより、オプション情報と生成されるシェルスクリプトを関連付けることができる。   The second line of the template file 313 includes a command statement for calling the generated option information. “Optioninfo” on the second line is a file name of option information described later. By determining the file name of the option information in advance, changes when generating a shell script from the template file 313 are reduced. As a result, the option information can be associated with the generated shell script.

テンプレートファイル313の3行目には、コマンド全体の実行に要する時間を出力し、コマンドの実行の要否を確認するための出力文が含まれる。   The third line of the template file 313 includes an output sentence for outputting the time required for executing the entire command and confirming whether or not the command needs to be executed.

テンプレートファイル313の4行目には、実行の要否の入力を受け付ける受付文が含まれる。ここでは、「y」を受け付けると、コマンドが実行され、「n」を受け付けると、コマンドが実行されない。テンプレートファイル313の5行目には、受け付けた情報が何であるかを判別する判定文が含まれる。   The fourth line of the template file 313 includes an acceptance sentence that accepts an input of necessity of execution. Here, when “y” is received, the command is executed, and when “n” is received, the command is not executed. The fifth line of the template file 313 includes a determination sentence for determining what the received information is.

テンプレートファイル313の6行目には、「y」が入力された場合における分岐文が含まれる。テンプレートファイル313の7行目には、実行が完了したことを出力する出力文が含まれる。ここで、テンプレートファイル313の6行目と7行目の間に、コマンドが追加される。   The sixth line of the template file 313 includes a branch sentence when “y” is input. The seventh line of the template file 313 includes an output statement that outputs the completion of execution. Here, a command is added between the sixth and seventh lines of the template file 313.

また、テンプレートファイル313の9行目には、「n」が入力された場合における分岐文が含まれる。テンプレートファイル313の10行目には、実行がキャンセルされたことを出力する出力文が含まれる。   Further, the ninth line of the template file 313 includes a branch sentence when “n” is input. The tenth line of the template file 313 includes an output statement that outputs that execution has been canceled.

なお、1行目や12行目から16行目には、例外に関する文や形式的な文が含まれるため、詳細な説明を省略する。   The first line and the 12th to 16th lines contain exception-related sentences and formal sentences, and thus detailed description thereof is omitted.

図3の説明に戻って、取得部301は、コマンド実行ログ311を取得する。コマンド実行ログ311を取得する処理としては、例えば、取得部301は、記憶部310に記憶されたコマンド実行ログ311を取得する。また、取得部301は、例えば、I/F206を用いてネットワーク207を介してコマンド実行ログ311を取得してもよい。   Returning to the description of FIG. 3, the acquisition unit 301 acquires the command execution log 311. As processing for acquiring the command execution log 311, for example, the acquisition unit 301 acquires the command execution log 311 stored in the storage unit 310. The acquisition unit 301 may acquire the command execution log 311 via the network 207 using the I / F 206, for example.

つぎに、抽出部302は、コマンドリスト312を参照して、取得部301によって取得されたコマンド実行ログ311から、実行履歴におけるコマンドと引数とを特定する。また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合、抽出部302は、コマンドリスト312を参照して、複数のコマンドのそれぞれのコマンドについて、コマンドとコマンドに対応付けて入力された引数とを特定する。ここで、コマンドと引数とを特定する具体的な方法としては、2つの方法が挙げられる。   Next, the extraction unit 302 refers to the command list 312 and identifies a command and an argument in the execution history from the command execution log 311 acquired by the acquisition unit 301. When the command execution log 311 includes a plurality of commands executed continuously, the extraction unit 302 refers to the command list 312 and associates each command of the plurality of commands with the command and the command. Identify the input argument. Here, there are two specific methods for specifying the command and the argument.

1つ目の特定方法としては、抽出部302は、例えば、コマンドリスト312を参照して、取得部301によって取得されたコマンド実行ログ311から、コマンドを特定することにより、コマンドとコマンドに対応付けて入力された引数と、を特定する。より具体的には、抽出部302は、例えば、コマンド実行ログ311に含まれる先頭の行から終端の行までを順に読み込む。そして、抽出部302は、読み込んだ各行について、コマンドリスト312に記憶されたコマンドを特定する。そして、抽出部302は、各行について、特定したコマンドの直前に記述された「asadmin」と、コマンドと、コマンドより後に記述された内容と、を含む部分を実行部分として抽出する。そして、抽出部302は、抽出した実行部分のうち、コマンド以降に記述された内容をコマンドに対応付けて入力された引数として特定する。   As a first specifying method, for example, the extraction unit 302 refers to the command list 312 and specifies a command from the command execution log 311 acquired by the acquisition unit 301, thereby associating the command with the command. To identify the argument entered. More specifically, the extraction unit 302 sequentially reads from the first line to the last line included in the command execution log 311, for example. Then, the extraction unit 302 identifies the command stored in the command list 312 for each read line. Then, the extraction unit 302 extracts, for each line, a portion including “asadmin” described immediately before the specified command, the command, and the content described after the command as an execution portion. Then, the extraction unit 302 identifies the contents described after the command in the extracted execution part as an argument input in association with the command.

2つ目の特定方法としては、抽出部302は、例えば、コマンド実行ログ311に含まれる各行について、予め決められた部分以外の部分を実行部分として抽出する。図4において、予め決められた部分とは、例えば、始タイムスタンプまたは終了タイムスタンプを含み、「START」または「END( )」よりも前の部分である。開これにより、抽出部302は、コマンド実行ログ311から、予め決められた部分を削除した残りの部分を実行部分として抽出する。抽出部302は、コマンドリスト312を参照して、抽出した実行部分から、コマンドを特定する。そして、抽出部302は、抽出した実行部分のうち特定したコマンド以降に記述された内容を引数として特定する。   As a second specifying method, for example, the extraction unit 302 extracts a part other than a predetermined part as an execution part for each line included in the command execution log 311. In FIG. 4, the predetermined portion includes, for example, a start time stamp or an end time stamp, and is a portion before “START” or “END ()”. As a result, the extraction unit 302 extracts, from the command execution log 311, the remaining part obtained by deleting a predetermined part as an execution part. The extraction unit 302 refers to the command list 312 and identifies a command from the extracted execution part. Then, the extraction unit 302 specifies the content described after the specified command in the extracted execution part as an argument.

また、図4に示すように、コマンドは、開始タイムスタンプと、終了タイムスタンプとが対応付けられているため、コマンド実行ログ311では、連続する2つの行において同一のコマンドが含まれる。そこで、抽出部302は、開始タイムスタンプを含む行については実行部分を抽出し、終了タイムスタンプを含む行については実行部分を抽出しないようにしてもよい。または、抽出部302は、終了タイムスタンプを含む行については実行部分を抽出し、開始タイムスタンプを含む行については実行部分を抽出しないようにしてもよい。また、開始タイムスタンプを含む行および終了タイムスタンプを含む行のそれぞれについて実行部分を抽出して実行部分ファイルに追加した後に、同一の2つの実行部分のうち一方の実行部分を削除してもよい。   As shown in FIG. 4, since the start time stamp and the end time stamp are associated with each other in the command, the command execution log 311 includes the same command in two consecutive lines. Therefore, the extraction unit 302 may extract the execution part for the line including the start time stamp and may not extract the execution part for the line including the end time stamp. Alternatively, the extraction unit 302 may extract the execution part for the line including the end time stamp and may not extract the execution part for the line including the start time stamp. In addition, after the execution part is extracted and added to the execution part file for each of the line including the start time stamp and the line including the end time stamp, one of the two execution parts may be deleted. .

図7は、実行部分の抽出例を示す説明図である。図7における点線枠の部分が、上述した予め決められた部分である。実行部分700は、コマンド実行ログ311の複数の行の順に、複数の行の各々の行について抽出されたコマンドと引数とを含む実行部分が並べられた情報である。抽出部302によって抽出された実行部分700は、例えば、記憶部310などに記憶される。   FIG. 7 is an explanatory diagram of an example of extracting an execution part. The portion indicated by the dotted line in FIG. 7 is the above-described predetermined portion. The execution part 700 is information in which execution parts including commands and arguments extracted for each of the plurality of lines are arranged in the order of the plurality of lines in the command execution log 311. The execution part 700 extracted by the extraction unit 302 is stored in the storage unit 310, for example.

また、算出部305は、コマンド実行ログ311に含まれる複数のコマンドのそれぞれのコマンドについて、開始タイムスタンプおよび終了タイムスタンプに基づいて、コマンドの実行に要した処理時間を算出する。   Further, the calculation unit 305 calculates the processing time required for command execution based on the start time stamp and the end time stamp for each of the commands included in the command execution log 311.

また、算出部305は、複数のコマンドのそれぞれのコマンドについて算出した処理時間の合計値を、シェルスクリプトに含まれる複数のコマンドの実行に要する合計処理時間として算出する。   Further, the calculation unit 305 calculates the total processing time calculated for each command of the plurality of commands as the total processing time required for executing the plurality of commands included in the shell script.

つぎに、図3に示す第1生成部303は、特定したコマンドと、特定した引数を置き換えた変数とを含む実行部分に基づいて、変数に設定される値を引数として特定したコマンドを実行可能なプログラムを生成する。プログラムは上述したようにシェルスクリプトである。第1生成部303によって生成されたシェルスクリプトは、例えば、記憶部310などに記憶される。   Next, the first generation unit 303 illustrated in FIG. 3 can execute the command specified with the value set in the variable as an argument based on the execution part including the specified command and the variable in which the specified argument is replaced. A simple program. The program is a shell script as described above. The shell script generated by the first generation unit 303 is stored in the storage unit 310, for example.

また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合における第1生成部303によるシェルスクリプトの生成処理について説明する。第1生成部303は、特定したコマンドと特定した引数を置き換えた変数とを含む実行部分を、複数のコマンドの実行順に従って特定したコマンドを実行可能なシェルスクリプトを生成する。   Also, shell script generation processing by the first generation unit 303 in the case where a plurality of commands executed in succession are included in the command execution log 311 will be described. The first generation unit 303 generates a shell script that can execute a command in which an execution part including the specified command and a variable in which the specified argument is replaced is specified according to the execution order of the plurality of commands.

ここで、複数のコマンドの実行順の特定方法は、例えば、2つの方法がある。まず、1つ目の方法を説明する。上述したようにコマンド実行ログ311がコマンドの実行順に先頭から並んでいる。第1生成部303は、コマンドの実行順を、コマンド実行ログ311における先頭行からのコマンドの並び順に基づいて特定することができる。つぎに、2つ目の方法を説明する。コマンド実行ログ311は、各コマンドについてコマンドに対応付けられてコマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列が含まれる。このため、第1生成部303は、コマンドの実行順を、コマンド実行ログ311内の各コマンドに対応付けられた実行開始時刻を示す情報または実行終了時刻を示す情報に基づいて特定することができる。   Here, there are two methods for specifying the execution order of a plurality of commands, for example. First, the first method will be described. As described above, the command execution log 311 is arranged from the top in the command execution order. The first generation unit 303 can specify the execution order of commands based on the order of commands from the first line in the command execution log 311. Next, the second method will be described. The command execution log 311 includes a character string indicating the execution start time of the command and a character string indicating the execution end time associated with the command for each command. For this reason, the 1st production | generation part 303 can specify the execution order of a command based on the information which shows the execution start time matched with each command in the command execution log 311, or the information which shows execution end time. .

上述した抽出部302は、コマンド実行ログ311の先頭行からコマンドの実行順に実行部分を抽出している。このため、実行部分700には、コマンドの実行順に先頭から複数のコマンドが並んでいる。このため、第1生成部303は、実行部分700におけるコマンドの並びをそのまま利用してシェルスクリプトを生成すればよい。   The extraction unit 302 described above extracts execution parts from the first line of the command execution log 311 in the command execution order. Therefore, a plurality of commands are arranged in the execution portion 700 from the top in the command execution order. For this reason, the 1st production | generation part 303 should just produce | generate a shell script using the sequence of the command in the execution part 700 as it is.

具体的には、第1生成部303は、例えば、テンプレートファイル313に、抽出部302によって抽出された実行部分700が追加されたシェルスクリプトを生成する。より具体的には、第1生成部303は、図6におけるテンプレートファイル313の6行目と7行目の間に、実行部分700を追加することによりシェルスクリプトを生成する。そして、第1生成部303は、シェルスクリプト内の実行部分700に含まれる引数を変数に置換する。変数は、例えば、「$変数名」によって表される。ここでは、引数をすべて大文字にすることによって変数とする。第1生成部303は、実行部分700において、先頭から2番目のコマンドに対応付けられた引数「IJServer005」を変数「$IJSERVER005」に置き換える。なお、第1生成部303が、テンプレートファイル313に実行部分700を追加した後に引数を変数に置き換える例を説明したが、これに限らず、実行部分700に含まれる引数を変数に置き換えた実行部分をテンプレートファイル313に追加してもよい。   Specifically, the first generation unit 303 generates, for example, a shell script in which the execution part 700 extracted by the extraction unit 302 is added to the template file 313. More specifically, the 1st production | generation part 303 produces | generates a shell script by adding the execution part 700 between the 6th line and the 7th line of the template file 313 in FIG. Then, the first generation unit 303 replaces the argument included in the execution part 700 in the shell script with a variable. The variable is represented by “$ variable name”, for example. Here, the argument is made a variable by making it all capital letters. In the execution part 700, the first generation unit 303 replaces the argument “IJServer005” associated with the second command from the beginning with the variable “$ IJSERVER005”. In addition, although the example which replaced the argument with a variable after the 1st production | generation part 303 added the execution part 700 to the template file 313 was demonstrated, not only this but the execution part which replaced the argument contained in the execution part 700 with the variable May be added to the template file 313.

また、第1生成部303は、特定した引数のうちの同一値の引数を同一の変数に置き換えたシェルスクリプトを生成する。引数が同一値であるとは、引数として同じ文字列が設定されていることを示す。例えば、実行部分700において、先頭から2番目のコマンドに対応付けられた引数「IJServer005」は、先頭から4番目に対応付けられた2つ目の引数と、先頭から5番目に対応付けられた引数と、同じである。このため、第1生成部303は、実行部分700に含まれる各実行部分のうちの引数「IJServer005」を同じ変数「$IJSERVER005」に置き換える。これにより、管理者は、同じ引数を一括で設定することができるため、シェルスクリプトを簡単に実行させることができる。   In addition, the first generation unit 303 generates a shell script in which arguments having the same value among the specified arguments are replaced with the same variable. The argument having the same value indicates that the same character string is set as the argument. For example, in the execution part 700, the argument “IJServer005” associated with the second command from the top is the second argument associated with the fourth from the top and the argument associated with the fifth from the top. And the same. Therefore, the first generation unit 303 replaces the argument “IJServer005” in each execution part included in the execution part 700 with the same variable “$ IJSERVER005”. As a result, the administrator can set the same argument in a lump so that the shell script can be easily executed.

また、第1生成部303は、コマンドマニュアル情報314に基づいて、抽出部302によって特定された引数のうち、オプション以外の引数を特定する。そして、第1生成部303は、オプション以外の引数を変数に置き換える。第1生成部303は、オプションについては変数に置換しなくてよい。   Further, the first generation unit 303 specifies arguments other than options among the arguments specified by the extraction unit 302 based on the command manual information 314. Then, the first generation unit 303 replaces arguments other than options with variables. The first generation unit 303 does not have to replace the option with a variable.

また、第1生成部303は、シェルスクリプトに追加した複数のコマンドのそれぞれについて、コマンドリスト312から、コマンドに対応付けられたシェル用コメント情報を取得する。そして、第1生成部303は、シェルスクリプトに追加したコマンドに取得したシェル用コメント情報を関連付ける。   Further, the first generation unit 303 acquires shell comment information associated with the command from the command list 312 for each of the plurality of commands added to the shell script. Then, the first generation unit 303 associates the acquired comment information for shell with the command added to the shell script.

また、第1生成部303は、シェルスクリプトに追加した複数のコマンドのそれぞれについて、算出部305によって算出された処理時間を関連付けて出力する。具体的には、第1生成部303は、例えば、シェルスクリプトに追加したコマンドに関するコメント情報として、算出部305によって算出された処理時間を示す文字列をシェルスクリプトに追加する。   The first generation unit 303 also outputs the processing time calculated by the calculation unit 305 in association with each of the plurality of commands added to the shell script. Specifically, the first generation unit 303 adds, for example, a character string indicating the processing time calculated by the calculation unit 305 to the shell script as comment information regarding the command added to the shell script.

また、第1生成部303は、シェルスクリプトに、算出部305によって算出された合計処理時間を関連付けて出力する。具体的には、第1生成部303は、例えば、シェルスクリプトに、算出部305によって算出された合計処理時間を出力する出力文を追加する。また、第1生成部303は、例えば、シェルスクリプトに、コメント情報として、算出部305によって算出された合計処理時間を示す文字列を追加する。   The first generation unit 303 outputs the shell script in association with the total processing time calculated by the calculation unit 305. Specifically, the first generation unit 303 adds, for example, an output sentence that outputs the total processing time calculated by the calculation unit 305 to the shell script. For example, the first generation unit 303 adds a character string indicating the total processing time calculated by the calculation unit 305 as comment information to the shell script.

図8は、シェルスクリプト例を示す説明図である。シェルスクリプト800は、例えば、図6に示すテンプレートファイル313に実行部分700が追加され、実行部分700に含まれる引数が変数に置き換えられたプログラムである。シェルスクリプト800の3行目に示す出力文内の「シェルの所要時間は約 秒」に算出された合計処理時間を示す文字列が追加される。図8の例では、シェルスクリプト800が実行されると、「シェルの所要時間は約112秒です。」と出力される。また、コマンドごとに算出された処理時間を示す文字列は、コマンドを実行した装置の性能や実行状況などに応じて異なるため、参考値としてシェルスクリプト800内に追加される。これにより、管理者は、作業時間の目安を付けることができる。   FIG. 8 is an explanatory diagram illustrating an example of a shell script. The shell script 800 is, for example, a program in which an execution part 700 is added to the template file 313 shown in FIG. 6 and arguments included in the execution part 700 are replaced with variables. A character string indicating the total processing time calculated in “the required time of the shell is about second” in the output sentence shown in the third line of the shell script 800 is added. In the example of FIG. 8, when the shell script 800 is executed, “the time required for the shell is about 112 seconds” is output. Further, the character string indicating the processing time calculated for each command differs depending on the performance and execution status of the device that executed the command, and is added as a reference value in the shell script 800. As a result, the administrator can give a rough estimate of the working time.

また、シェルスクリプト800では、7行目から28行目に実行部分700が追加される。ここで、シェルスクリプト800において、「#」以降の文字列は、コメント情報である。また、(7+i)行目のコメント情報は、(8+i)行目のコマンドについて取得されたシェル用コメント情報および算出された処理時間を示す文字列を含む。iは、0以上の整数である。シェルスクリプト800によれば、19行目のコメント情報により、20行目に含まれる「asadmin create−cluster $IJSERVER007」がインスタンスの作成に関するコマンドであり、処理時間が約13秒であることが分かる。このように、管理者は、各コマンドによりどのような処理が実行されるかを把握することができ、各コマンドの作業時間の目安を付けることができる。   In the shell script 800, an execution part 700 is added from the seventh line to the 28th line. Here, in the shell script 800, the character string after “#” is comment information. Further, the comment information on the (7 + i) line includes the shell comment information acquired for the command on the (8 + i) line and a character string indicating the calculated processing time. i is an integer of 0 or more. According to the shell script 800, it can be understood from the comment information on the 19th line that “asadmin create-cluster $ IJSERVER007” included in the 20th line is a command related to creation of an instance, and the processing time is about 13 seconds. In this way, the administrator can grasp what processing is executed by each command, and can give an indication of the working time of each command.

また、シェルスクリプト800の12行目、14行目、22行目、24行目などに示すように、コマンドに付加された「−−target」は、オプションであるため、変数に置き換えられていない。   Further, as shown in the 12th line, the 14th line, the 22nd line, the 24th line, and the like of the shell script 800, “--target” added to the command is an option and is not replaced with a variable. .

また、図3の説明に戻って、第2生成部304は、例えば、変数と、特定された引数と、を対応付けた対応情報を生成する。ここで、対応情報については、オプション情報とも称する。オプション情報のファイル名は、上述したように「оptiоninfо」とする。このように、引数と変数とを対応付けてリスト化することにより、変数の元となる引数が分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。上述したように、コマンドリスト312は、コマンドと、コマンドに関するコメント情報と、を対応付けて記憶してある。ここでのコマンドに関するコメント情報は、上述したオプション用コメント情報である。第2生成部304は、コマンドリスト312を参照して、変数と、特定された引数と、特定された引数に対応するコマンドに対応付けられたコメント情報と、を対応付けたオプション情報を生成する。これにより、変数の元となる引数が、いずれのコマンドに対応付けて入力された引数であるかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。   Returning to the description of FIG. 3, the second generation unit 304 generates correspondence information in which a variable is associated with a specified argument, for example. Here, the correspondence information is also referred to as option information. As described above, the file name of the option information is “оoptininfo”. In this way, by listing arguments and variables in association with each other, it becomes easy to understand the argument that is the source of the variable, and the administrator can easily set a new argument for the variable. As described above, the command list 312 stores a command and comment information related to the command in association with each other. The comment information regarding the command here is the above-described option comment information. The second generation unit 304 refers to the command list 312, and generates option information that associates the variable, the identified argument, and the comment information associated with the command corresponding to the identified argument. . This makes it easy to understand which argument is the argument that is input in association with which command, and the administrator can easily set a new argument for the variable.

また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合における第2生成部304によるオプション情報の生成処理について説明する。第2生成部304は、コマンドリスト312を参照して、複数のコマンドのそれぞれのコマンドについて特定した引数と変数との組み合わせを引数に対応するコマンドの実行順に従って並べたオプション情報を生成する。すなわち、生成されるオプション情報では、コマンド実行ログ311における先頭行からの引数の出現順に引数と変数との組み合わせが並べられる。複数のコマンドの実行順の特定方法は、例えば、上述した2つの方法であり、詳細な説明を省略する。   An option information generation process performed by the second generation unit 304 when the command execution log 311 includes a plurality of commands executed in succession will be described. The second generation unit 304 refers to the command list 312, and generates option information in which combinations of arguments and variables specified for the commands of the plurality of commands are arranged according to the execution order of the commands corresponding to the arguments. That is, in the generated option information, combinations of arguments and variables are arranged in the order of appearance of arguments from the first line in the command execution log 311. The method for specifying the execution order of a plurality of commands is, for example, the two methods described above, and detailed description thereof is omitted.

また、第1生成部303において同一値の引数が同一の変数に置き換えられた場合における第2生成部304によるオプション情報の生成処理について説明する。第2生成部304は、例えば、コマンドリスト312を参照して、変数と引数との組み合わせについて、引数に対応するコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に従って並べたコメント情報群を対応付けたオプション情報を生成する。すなわち、生成されるオプション情報では、変数と引数との組み合わせについて、コマンド実行ログ311における先頭行からのコマンドの出現順にコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に並べられる。   An option information generation process performed by the second generation unit 304 when an argument having the same value is replaced with the same variable in the first generation unit 303 will be described. For example, the second generation unit 304 refers to the command list 312, and for the combination of the variable and the argument, comment information in which the comment information associated with the command corresponding to the argument is arranged according to the execution order of the plurality of commands. Option information that associates groups is generated. That is, in the generated option information, the comment information associated with the commands in the order of appearance of the commands from the first line in the command execution log 311 for the combinations of variables and arguments is arranged in the order of execution of the plurality of commands.

図9は、オプション情報例を示す説明図である。オプション情報900は、変数と、引数と、引数を含む実行部分におけるコマンドに対応付けられたコメント情報と、を対応付けて記憶する。また、変数は、コマンド実行ログ311における引数の出現順に並べられてある。コマンド実行ログ311はコマンドの実行順に並んでいるため、引数の出現順とは、引数を対応付けられたコマンドの実行順である。   FIG. 9 is an explanatory diagram illustrating an example of option information. The option information 900 stores a variable, an argument, and comment information associated with a command in the execution part including the argument in association with each other. The variables are arranged in the order in which the arguments appear in the command execution log 311. Since the command execution log 311 is arranged in the execution order of the commands, the appearance order of the arguments is the execution order of the commands associated with the arguments.

オプション情報900において、「#」以降の文字列は、コメント情報である。例えば、変数「$IJSERVER005」は、引数「IJServer005」を置き換えた変数である。そして、引数「IJServer005」は、コマンド実行ログ311において、「クラスタを作成」、「インスタンスを作成」、「アプリケーションを配備」、「クラスタを起動」のそれぞれに対応するコマンドに対応付けられてある。上述したように、各変数において、コメント情報は、上述したように、コマンドの実行順に並べられてある。   In the option information 900, the character string after “#” is comment information. For example, the variable “$ IJSERVER005” is a variable in which the argument “IJServer005” is replaced. The argument “IJServer005” is associated with commands corresponding to “create cluster”, “create instance”, “deploy application”, and “launch cluster” in the command execution log 311. As described above, in each variable, the comment information is arranged in the order of command execution as described above.

上述したように、図8に示すシェルスクリプト800の2行目には、sоurceコマンドと、オプション情報900のファイル名と、が含まれる。これにより、管理対象のサーバが、シェルスクリプト800を実行すると、オプション情報900が呼び出される。このように、オプション情報900とシェルスクリプト800とは関連付けられてある。   As described above, the source command and the file name of the option information 900 are included in the second line of the shell script 800 shown in FIG. As a result, when the management target server executes the shell script 800, the option information 900 is called. As described above, the option information 900 and the shell script 800 are associated with each other.

したがって、管理者は、オプション情報900内の引数を書き換えることによりまとめて変数に引数を設定することができる。   Therefore, the administrator can collectively set arguments to variables by rewriting the arguments in the option information 900.

(生成装置100による生成処理手順例)
図10および図11は、生成装置による生成処理手順例を示すフローチャートである。取得部301は、記憶部310にコマンドリスト312が存在するか否かを判断する(ステップS1001)。取得部301は、コマンドリスト312が存在すると判断した場合(ステップS1001:Yes)、コマンドリスト312を記憶部310から取得する。
(Example of generation processing procedure by generation device 100)
10 and 11 are flowcharts illustrating an example of a generation processing procedure performed by the generation device. The acquisition unit 301 determines whether or not the command list 312 exists in the storage unit 310 (step S1001). If the acquisition unit 301 determines that the command list 312 exists (step S1001: Yes), the acquisition unit 301 acquires the command list 312 from the storage unit 310.

一方、取得部301は、記憶部310にコマンドリスト312が存在しないと判断した場合(ステップS1001:No)、コマンドリスト312を取得する(ステップS1002)。ステップS1002において、取得部301は、ネットワーク207を介して他の装置からコマンドリスト312を取得してもよいし、入力装置(図示省略)に対する管理者の操作入力などによってコマンドリスト312を取得してもよい。   On the other hand, when determining that the command list 312 does not exist in the storage unit 310 (step S1001: No), the acquiring unit 301 acquires the command list 312 (step S1002). In step S <b> 1002, the acquisition unit 301 may acquire the command list 312 from another device via the network 207, or acquire the command list 312 by an administrator's operation input to the input device (not shown). Also good.

また、抽出部302は、コマンド実行ログ311から、コマンドリスト312に基づいて、コマンドと引数とを含む実行部分を抽出する(ステップS1003)。ステップS1003において、抽出部302は、コマンド実行ログ311から、コマンドリスト312に基づいて、コマンドと引数とを特定することにより、実行部分を抽出する例を挙げている。このため、抽出された実行部分においてコマンドと引数とは特定されてある。上述したように、ステップS1003に記載の処理に代わって、抽出部302は、コマンド実行ログ311から実行部分を抽出した後に、抽出した実行部分からコマンドリスト312に基づいてコマンドと引数を特定する処理を行ってもよい。   Further, the extraction unit 302 extracts an execution part including a command and an argument from the command execution log 311 based on the command list 312 (step S1003). In step S1003, the extraction unit 302 extracts an execution part from the command execution log 311 by specifying a command and an argument based on the command list 312. For this reason, the command and the argument are specified in the extracted execution part. As described above, instead of the processing described in step S1003, the extraction unit 302 extracts an execution part from the command execution log 311 and then specifies a command and an argument based on the command list 312 from the extracted execution part. May be performed.

つぎに、第1生成部303は、テンプレートファイル313に、抽出した実行部分を追加したシェルスクリプトを生成する(ステップS1004)。そして、第1生成部303は、コマンドリスト312から、抽出した実行部分に含まれるコマンドに対応付けられた各コメント情報を取得する(ステップS1005)。ステップS1005において取得されるコメント情報は、コマンドリスト312に含まれるスクリプト用コメント情報およびオプション用コメント情報である。   Next, the 1st production | generation part 303 produces | generates the shell script which added the extracted execution part to the template file 313 (step S1004). Then, the first generation unit 303 acquires each comment information associated with the command included in the extracted execution part from the command list 312 (step S1005). The comment information acquired in step S1005 is script comment information and option comment information included in the command list 312.

つぎに、第1生成部303は、シェルスクリプト800に、複数のコマンドのそれぞれのコマンドについて取得したスクリプト用コメント情報を追加する(ステップS1006)。ステップS1006において、第1生成部303は、図8に示すように、シェルスクリプト800に含まれる複数のコマンドのそれぞれに対応付けて取得したスクリプト用コメント情報を追加する。   Next, the first generation unit 303 adds script comment information acquired for each command of the plurality of commands to the shell script 800 (step S1006). In step S1006, the first generation unit 303 adds the comment information for script acquired in association with each of the plurality of commands included in the shell script 800, as shown in FIG.

つぎに、算出部305は、コマンド実行ログ311に基づいて、実行された複数のコマンドのそれぞれのコマンドの処理時間を算出する(ステップS1101)。つづいて、算出部305は、それぞれのコマンドについて算出した処理時間を合計することにより合計処理時間を算出する(ステップS1102)。そして、第1生成部303は、実行されたコマンドごとに算出した処理時間を示す文字列をシェルスクリプト800に追加する(ステップS1103)。ステップS1103において、第1生成部303は、シェルスクリプト800内のコマンドごとに算出した処理時間を対応付けて出力する。   Next, the calculation unit 305 calculates the processing time of each command of a plurality of executed commands based on the command execution log 311 (step S1101). Subsequently, the calculation unit 305 calculates the total processing time by summing up the processing times calculated for the respective commands (step S1102). Then, the first generation unit 303 adds a character string indicating the processing time calculated for each executed command to the shell script 800 (step S1103). In step S1103, the first generation unit 303 outputs the processing time calculated for each command in the shell script 800 in association with each other.

つぎに、第1生成部303は、シェルスクリプト800に、合計処理時間を追加する(ステップS1104)。ステップS1104において、合計処理時間を追加する処理としては、第1生成部303は、例えば、合計処理時間を出力する出力文をシェルスクリプト800に追加する。テンプレートファイル313には、合計処理時間を出力するための出力文が記述されているため、ステップS1104において、合計処理時間を追加する処理としては、第1生成部303は、算出した合計処理時間を示す文字列を出力文に追加する。   Next, the first generation unit 303 adds the total processing time to the shell script 800 (step S1104). In step S1104, as a process of adding the total processing time, the first generation unit 303 adds, for example, an output statement that outputs the total processing time to the shell script 800. Since an output statement for outputting the total processing time is described in the template file 313, as a process of adding the total processing time in step S1104, the first generation unit 303 uses the calculated total processing time. Add the indicated string to the output statement.

つづいて、第1生成部303は、コマンドマニュアル情報314に基づいて、シェルスクリプト800において引数を変数に置換する(ステップS1105)。ステップS1105において、第1生成部303は、コマンドマニュアル情報314に基づいて、特定された各引数のうちオプション以外の引数を特定する。そして、ステップS1105において、第1生成部303は、オプション以外の引数を、「$」と引数を大文字にした文字列との組み合わせの文字列に置換する。「$文字列(変数名)」によって変数が表される。引数を大文字にした文字列を変数とすることにより、シェルスクリプト800に含まれる各引数のうちの同一値の引数を同一の変数に置き換えることができる。ここで、引数に数値が含まれる場合、数値を文字列として変数とする。   Subsequently, the first generation unit 303 replaces the argument with a variable in the shell script 800 based on the command manual information 314 (step S1105). In step S <b> 1105, the first generation unit 303 specifies an argument other than the option among the specified arguments based on the command manual information 314. In step S1105, the first generation unit 303 replaces the argument other than the option with a character string that is a combination of “$” and a character string in which the argument is capitalized. A variable is represented by “$ character string (variable name)”. By using a character string in which the argument is capitalized as a variable, an argument having the same value among the arguments included in the shell script 800 can be replaced with the same variable. Here, when a numerical value is included in the argument, the numerical value is used as a variable as a variable.

つぎに、第2生成部304は、コマンドの実行順に、変数と、引数と、コマンドに対応付けられたオプション用コメント情報とを対応付けたオプション情報900を生成する(ステップS1106)。そして、第2生成部304は、オプション情報900において、オプション用コメント情報をコマンドの実行順に並べ(ステップS1107)、一連の処理を終了する。なお、第2生成部304は、ステップS1106とステップS1107とを同時に行ってもよい。   Next, the second generation unit 304 generates option information 900 in which variables, arguments, and option comment information associated with the command are associated in order of command execution (step S1106). Then, the second generation unit 304 arranges the option comment information in the option information 900 in the command execution order (step S1107), and ends the series of processes. Note that the second generation unit 304 may perform Step S1106 and Step S1107 at the same time.

以上説明したように、生成装置100は、コマンドリストを参照してコマンド実行ログ内の実行履歴におけるコマンドと引数とを特定し、コマンドと引数を置換した変数とに基づきシェルスクリプトを生成する。これにより、管理者は、シェルスクリプトの作成の手間を省くことができる。また、管理者は、シェルスクリプト内の変数に引数の値を与えて管理対象のサーバにシェルスクリプトを実行させるだけで、過去に行った作業を簡単に繰り返し行うことができる。したがって、生成装置100は、管理者がコマンドを何度も入力する手間を省くことができる。   As described above, the generation device 100 refers to the command list, identifies the command and argument in the execution history in the command execution log, and generates a shell script based on the command and the variable with the argument replaced. As a result, the administrator can save the trouble of creating a shell script. In addition, the administrator can easily repeat the work performed in the past simply by giving an argument value to a variable in the shell script and causing the managed server to execute the shell script. Accordingly, the generation apparatus 100 can save the administrator from inputting the command many times.

また、生成装置100は、引数と変数とを対応付けてリスト化する。これにより、変数の元となる引数が分かり易いため、管理者は、変数に新たな引数を設定しやすくなる。   In addition, the generation device 100 associates the argument with the variable and creates a list. This makes it easier for the administrator to set a new argument for the variable because the argument that is the source of the variable is easy to understand.

また、生成装置100は、コマンドにコメント情報を対応付けられたコマンドリストを参照して、変数と、引数と、引数に対応するコマンドに対応付けられたコメント情報と、を対応付けてリスト化する。これにより、変数が、シェルスクリプトにおいていずれのコマンドに対応付けられているかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。   In addition, the generation apparatus 100 refers to the command list in which the comment information is associated with the command, and associates the variable, the argument, and the comment information associated with the command corresponding to the argument to form a list. . This makes it easy to understand which command is associated with the variable in the shell script, and the administrator can easily set a new argument for the variable.

また、生成装置100は、コマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含むコマンド実行ログを参照して算出したコマンドの処理時間をコマンドおよび変数に関連付けて出力する。これにより、管理者は、新たにコマンドをサーバに実行させる際のコマンドの処理時間の目安を付けることができる。   The generation apparatus 100 outputs the command processing time calculated by referring to the command execution log including the character string indicating the command execution start time and the character string indicating the execution end time in association with the command and the variable. As a result, the administrator can attach a guideline for the processing time of the command when the command is newly executed by the server.

また、生成装置100は、連続して実行された複数のコマンドの各々について特定したコマンドと特定した引数を置き換えた変数とに基づいて、複数のコマンドの実行順に従って特定したコマンドを実行可能なシェルスクリプトを生成する。これにより、シェルスクリプトの作成の手間を省くことができる。また、コマンド群を何度も入力する手間を省くことができ、作業を容易に繰り返すことができる。   Further, the generation apparatus 100 is a shell capable of executing the specified commands in accordance with the execution order of the plurality of commands based on the command specified for each of the plurality of commands executed continuously and the variable obtained by replacing the specified argument. Generate a script. This saves the trouble of creating a shell script. Further, it is possible to save the trouble of inputting the command group many times, and the operation can be easily repeated.

また、生成装置100は、コマンドリストを参照して、複数のコマンドのそれぞれのコマンドについて、特定した引数と、変数と、対応付けてリスト化する。これにより、管理者は、リスト化されたファイルにより変数に引数を一括して設定することができるため、シェルスクリプトを実行し易くなる。   In addition, the generation apparatus 100 refers to the command list and lists the specified argument and variable in association with each command of the plurality of commands. This makes it easier for the administrator to execute the shell script because arguments can be set in the variable in a batch using the listed files.

また、生成装置100は、引数に対応するコマンドの実行順に引数と変数とを対応付けてリスト化する。これにより、管理者は、一連のコマンドによる作業内容を理解し易くなる。   Further, the generation device 100 lists the argument and the variable in association with each other in the execution order of the command corresponding to the argument. As a result, the administrator can easily understand the work contents by the series of commands.

また、生成装置100は、コマンドに関するコメント情報が対応付けられたコマンドリストを参照して、変数と、特定した引数と、特定した引数に対応するコマンドに対応付けられたコメント情報と、を対応付けてリスト化する。これにより、変数がいずれのコマンドに対応付けられているかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。   Further, the generating apparatus 100 refers to the command list in which the comment information regarding the command is associated, and associates the variable, the identified argument, and the comment information associated with the command corresponding to the identified argument. To list. This makes it easy to understand which command the variable is associated with, and the administrator can easily set a new argument for the variable.

また、生成装置100は、同一値の引数を同じ変数に置き換え、変数と特定した引数との組み合わせに、特定した引数に対応するコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に並べたコメント情報群を対応付けてリスト化する。これにより、同一値の引数を一括して変更することができるため、管理者による引数の設定の手間を省くことができる。また、コメント情報をコマンドの実行順に並べることにより、管理者は、シェルスクリプトおよび変数と引数とのリストを参照した際に、一連のコマンドによる作業内容が理解し易くなる。   Further, the generation device 100 replaces the argument having the same value with the same variable, and arranges the comment information associated with the command corresponding to the specified argument in the combination of the variable and the specified argument in the order of execution of the plurality of commands. The comment information groups associated with each other are listed. As a result, arguments having the same value can be changed in a lump, so that it is possible to save the administrator from setting arguments. Also, by arranging the comment information in the order of command execution, the administrator can easily understand the work contents of a series of commands when referring to the list of shell scripts and variables and arguments.

また、生成装置100は、複数のコマンドのそれぞれのコマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含むコマンド実行ログを参照して、それぞれのコマンドの処理時間を合計することにより複数のコマンドの処理時間を算出する。これにより、管理者は、シェルスクリプトの処理時間の目安を付けることができる。   Further, the generation device 100 refers to a command execution log including a character string indicating the execution start time of each of the plurality of commands and a character string indicating the execution end time, and sums the processing time of each command. To calculate the processing time of a plurality of commands. As a result, the administrator can set an estimate of the processing time of the shell script.

また、生成装置100は、特定した引数のうち、オプション以外の引数を変数に置き換える。これにより、シェルスクリプトの実行時に変更する引数が変数に置き換わり、変更しなくてもよい引数が変数に置き換わらないため、管理者は、変数に新たな引数を設定しやすくなる。   In addition, the generating apparatus 100 replaces arguments other than the option among the specified arguments with variables. As a result, an argument that is changed when the shell script is executed is replaced with a variable, and an argument that does not need to be changed is not replaced with a variable. Therefore, the administrator can easily set a new argument for the variable.

なお、本実施の形態で説明した生成方法は、予め用意された生成プログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本生成プログラムは、磁気ディスク、光ディスク、USB(Universal Serial Bus)フラッシュメモリなどのコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また、生成プログラムは、インターネット等のネットワークを介して配布してもよい。   Note that the generation method described in the present embodiment can be realized by executing a generation program prepared in advance on a computer such as a personal computer or a workstation. The generation program is recorded on a computer-readable recording medium such as a magnetic disk, an optical disk, or a USB (Universal Serial Bus) flash memory, and is executed by being read from the recording medium by the computer. The generation program may be distributed through a network such as the Internet.

上述した実施の形態に関し、さらに以下の付記を開示する。   The following additional notes are disclosed with respect to the embodiment described above.

(付記1)コンピュータに、
コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行させることを特徴とする生成プログラム。
(Supplementary note 1)
Obtain a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation program characterized by causing processing to be executed.

(付記2)前記コンピュータに、
前記変数と、特定した前記引数と、を対応付けた対応情報を生成する、
処理を実行させることを特徴とする付記1に記載の生成プログラム。
(Supplementary note 2)
Generating correspondence information in which the variable is associated with the specified argument;
The generation program according to appendix 1, wherein the processing is executed.

(付記3)前記コマンドリストは、前記コマンドと、前記コマンドに関するコメント情報と、を対応付けて記憶し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記変数と、特定した前記引数と、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報と、を対応付けた前記対応情報を生成する、
ことを特徴とする付記2に記載の生成プログラム。
(Supplementary Note 3) The command list stores the command and comment information related to the command in association with each other,
The process of generating the correspondence information includes
Referring to the command list, generating the correspondence information in which the variable, the specified argument, and the comment information associated with the command corresponding to the specified argument are associated with each other;
The generation program according to supplementary note 2, characterized by:

(付記4)前記コマンド実行ログは、前記コマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含み、
前記コンピュータに、
前記コマンド実行ログを参照して、特定した前記コマンドの実行に要した時間を算出し、
算出した前記時間を、特定した前記コマンドと前記変数とに関連付けて出力する、
処理を実行させることを特徴とする付記1〜3のいずれか一つに記載の生成プログラム。
(Supplementary Note 4) The command execution log includes a character string indicating an execution start time and a character string indicating an execution end time of the command,
In the computer,
Referring to the command execution log, calculate the time required to execute the specified command,
Outputting the calculated time in association with the specified command and the variable;
The generation program according to any one of appendices 1 to 3, wherein the process is executed.

(付記5)前記コマンド実行ログは、連続して実行された複数のコマンドを含み、
前記コマンドリストは、前記複数のコマンドが記憶され、
前記コマンドと前記引数とを特定する処理は、
前記コマンドリストを参照して、前記コマンド実行ログから、前記複数のコマンドのそれぞれのコマンドについて、前記コマンドと前記コマンドに対応付けて入力された引数とを特定し、
前記プログラムを生成する処理は、
前記複数のコマンドのそれぞれのコマンドについて、特定した前記コマンドと、特定した前記引数を置き換えた前記変数とを含む実行部分に基づいて、前記複数のコマンドの実行順に従って前記コマンドを実行可能なプログラムを生成する、
ことを特徴とする付記1に記載の生成プログラム。
(Supplementary Note 5) The command execution log includes a plurality of commands executed continuously,
The command list stores the plurality of commands,
The process of specifying the command and the argument is:
Referring to the command list, for each command of the plurality of commands, from the command execution log, specify the command and an argument input in association with the command,
The process of generating the program is as follows:
For each command of the plurality of commands, a program capable of executing the command in accordance with the execution order of the plurality of commands based on an execution part including the specified command and the variable in which the specified argument is replaced Generate,
The generation program according to supplementary note 1, characterized in that:

(付記6)前記コンピュータに、
前記コマンドリストを参照して、前記複数のコマンドのそれぞれのコマンドについて、特定した前記引数と、前記変数と、を対応付けた対応情報を生成する、
処理を実行させることを特徴とする付記5に記載の生成プログラム。
(Appendix 6)
With reference to the command list, for each command of the plurality of commands, to generate correspondence information that associates the specified argument with the variable,
The generation program according to appendix 5, wherein the processing is executed.

(付記7)前記対応情報を生成する処理は、
前記コマンドリストを参照して、特定した前記引数と、前記変数と、の組み合わせを、特定した前記引数に対応する前記コマンドの実行順に従って並べた前記対応情報を生成する、
ことを特徴とする付記6に記載の生成プログラム。
(Supplementary note 7) The process of generating the correspondence information is as follows:
Referring to the command list, generating the correspondence information in which the combination of the specified argument and the variable is arranged according to the execution order of the command corresponding to the specified argument;
The generation program according to appendix 6, characterized by:

(付記8)前記コマンドリストは、前記複数のコマンドのそれぞれのコマンドについて、前記コマンドと、前記コマンドに関するコメント情報と、を対応付けて記憶し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記複数のコマンドのそれぞれのコマンドについて、前記変数と、特定した前記引数と、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報と、を対応付けた前記対応情報を生成する、
ことを特徴とする付記6に記載の生成プログラム。
(Supplementary Note 8) The command list stores, for each command of the plurality of commands, the command and comment information related to the command in association with each other,
The process of generating the correspondence information includes
Referring to the command list, for each command of the plurality of commands, associate the variable, the identified argument, and the comment information associated with the command corresponding to the identified argument. Generating the correspondence information,
The generation program according to appendix 6, characterized by:

(付記9)前記プログラムを生成する処理は、
前記複数のコマンドの実行順に従って、コマンドと、特定した前記引数のうちの同一値の引数を同一の変数に置き換えた前記コマンドに対応付けられた引数とを並べた前記プログラムを生成し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記変数と特定した前記引数との組み合わせに、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報を、前記複数のコマンドの実行順に並べたコメント情報群を対応付けた前記対応情報を生成する、
ことを特徴とする付記8に記載の生成プログラム。
(Supplementary note 9) The process of generating the program is as follows:
According to the execution order of the plurality of commands, generate the program in which a command and an argument associated with the command in which the argument of the same value among the specified arguments is replaced with the same variable are arranged,
The process of generating the correspondence information includes
Comment information in which the comment information associated with the command corresponding to the specified argument is arranged in the execution order of the plurality of commands in the combination of the variable and the specified argument with reference to the command list Generating the correspondence information associating groups;
The generation program according to appendix 8, characterized by:

(付記10)前記コマンド実行ログは、前記複数のコマンドのそれぞれのコマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含み、
前記コンピュータに、
前記コマンド実行ログを参照して、前記複数のコマンドのそれぞれのコマンドについて、特定した前記コマンドの前記実行開始時刻を示す文字列および前記実行終了時刻を示す文字列に基づいて、特定した前記コマンドの実行に要した時間を算出し、
特定した前記コマンドについて算出した前記時間の合計値を算出し、
算出した前記合計値を前記プログラムに関連付けて出力する、
処理を実行させることを特徴とする付記5〜9のいずれか一つに記載の生成プログラム。
(Supplementary Note 10) The command execution log includes a character string indicating an execution start time of each command of the plurality of commands and a character string indicating an execution end time,
In the computer,
Referring to the command execution log, for each command of the plurality of commands, based on the character string indicating the execution start time and the character string indicating the execution end time of the specified command, Calculate the time required for execution,
Calculate the total time calculated for the identified command,
Outputting the calculated total value in association with the program;
The generation program according to any one of appendices 5 to 9, wherein the process is executed.

(付記11)コンピュータが、
コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行することを特徴とする生成方法。
(Appendix 11) The computer
Obtain a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation method characterized by executing processing.

(付記12)コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行する制御部を有することを特徴とする生成装置。
(Supplementary Note 12) Obtaining a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation apparatus comprising a control unit that executes processing.

100 生成装置
101,311 コマンド実行ログ
102,312 コマンドリスト
103,800 シェルスクリプト
111,112,700 実行部分
301 取得部
302 抽出部
303 第1生成部
304 第2生成部
305 算出部
310 記憶部
313 テンプレートファイル
314 コマンドマニュアル情報
900 オプション情報
DESCRIPTION OF SYMBOLS 100 Generation apparatus 101,311 Command execution log 102,312 Command list 103,800 Shell script 111,112,700 Execution part 301 Acquisition part 302 Extraction part 303 1st generation part 304 2nd generation part 305 Calculation part 310 Storage part 313 Template File 314 Command manual information 900 Option information

Claims (11)

コンピュータに、
コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行させることを特徴とする生成プログラム。
On the computer,
Obtain a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation program characterized by causing processing to be executed.
前記コンピュータに、
前記変数と、特定した前記引数と、を対応付けた対応情報を生成する、
処理を実行させることを特徴とする請求項1に記載の生成プログラム。
In the computer,
Generating correspondence information in which the variable is associated with the specified argument;
The generation program according to claim 1, wherein processing is executed.
前記コマンドリストは、前記コマンドと、前記コマンドに関するコメント情報と、を対応付けて記憶し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記変数と、特定した前記引数と、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報と、を対応付けた前記対応情報を生成する、
ことを特徴とする請求項2に記載の生成プログラム。
The command list stores the command and comment information related to the command in association with each other,
The process of generating the correspondence information includes
Referring to the command list, generating the correspondence information in which the variable, the specified argument, and the comment information associated with the command corresponding to the specified argument are associated with each other;
The generation program according to claim 2.
前記コマンド実行ログは、連続して実行された複数のコマンドを含み、
前記コマンドリストは、前記複数のコマンドが記憶され、
前記コマンドと前記引数とを特定する処理は、
前記コマンドリストを参照して、前記コマンド実行ログから、前記複数のコマンドのそれぞれのコマンドについて、前記コマンドと前記コマンドに対応付けて入力された引数とを特定し、
前記プログラムを生成する処理は、
前記複数のコマンドのそれぞれのコマンドについて、特定した前記コマンドと、特定した前記引数を置き換えた前記変数とを含む実行部分に基づいて、前記複数のコマンドの実行順に従って前記コマンドを実行可能なプログラムを生成する、
ことを特徴とする請求項1に記載の生成プログラム。
The command execution log includes a plurality of commands executed continuously,
The command list stores the plurality of commands,
The process of specifying the command and the argument is:
Referring to the command list, for each command of the plurality of commands, from the command execution log, specify the command and an argument input in association with the command,
The process of generating the program is as follows:
For each command of the plurality of commands, a program capable of executing the command in accordance with the execution order of the plurality of commands based on an execution part including the specified command and the variable in which the specified argument is replaced Generate,
The generation program according to claim 1.
前記コンピュータに、
前記コマンドリストを参照して、前記複数のコマンドのそれぞれのコマンドについて、特定した前記引数と、前記変数と、を対応付けた対応情報を生成する、
処理を実行させることを特徴とする請求項4に記載の生成プログラム。
In the computer,
With reference to the command list, for each command of the plurality of commands, to generate correspondence information that associates the specified argument with the variable,
The generation program according to claim 4, wherein processing is executed.
前記対応情報を生成する処理は、
前記コマンドリストを参照して、特定した前記引数と、前記変数と、の組み合わせを、特定した前記引数に対応する前記コマンドの実行順に従って並べた前記対応情報を生成する、
ことを特徴とする請求項5に記載の生成プログラム。
The process of generating the correspondence information includes
Referring to the command list, generating the correspondence information in which the combination of the specified argument and the variable is arranged according to the execution order of the command corresponding to the specified argument;
The generation program according to claim 5.
前記コマンドリストは、前記複数のコマンドのそれぞれのコマンドについて、前記コマンドと、前記コマンドに関するコメント情報と、を対応付けて記憶し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記複数のコマンドのそれぞれのコマンドについて、前記変数と、特定した前記引数と、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報と、を対応付けた前記対応情報を生成する、
ことを特徴とする請求項5に記載の生成プログラム。
The command list stores the command and comment information related to the command in association with each command of the plurality of commands,
The process of generating the correspondence information includes
Referring to the command list, for each command of the plurality of commands, associate the variable, the identified argument, and the comment information associated with the command corresponding to the identified argument. Generating the correspondence information,
The generation program according to claim 5.
前記プログラムを生成する処理は、
前記複数のコマンドの実行順に従って、コマンドと、特定した前記引数のうちの同一値の引数を同一の変数に置き換えた前記コマンドに対応付けられた引数とを並べた前記プログラムを生成し、
前記対応情報を生成する処理は、
前記コマンドリストを参照して、前記変数と特定した前記引数との組み合わせに、特定した前記引数に対応する前記コマンドに対応付けられた前記コメント情報を、前記複数のコマンドの実行順に並べたコメント情報群を対応付けた前記対応情報を生成する、
ことを特徴とする請求項7に記載の生成プログラム。
The process of generating the program is as follows:
According to the execution order of the plurality of commands, generate the program in which a command and an argument associated with the command in which the argument of the same value among the specified arguments is replaced with the same variable are arranged,
The process of generating the correspondence information includes
Comment information in which the comment information associated with the command corresponding to the specified argument is arranged in the execution order of the plurality of commands in the combination of the variable and the specified argument with reference to the command list Generating the correspondence information associating groups;
The generation program according to claim 7.
前記コマンド実行ログは、前記複数のコマンドのそれぞれのコマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含み、
前記コンピュータに、
前記コマンド実行ログを参照して、前記複数のコマンドのそれぞれのコマンドについて、特定した前記コマンドの前記実行開始時刻を示す文字列および前記実行終了時刻を示す文字列に基づいて、特定した前記コマンドの実行に要した時間を算出し、
特定した前記コマンドについて算出した前記時間の合計値を算出し、
算出した前記合計値を前記プログラムに関連付けて出力する、
処理を実行させることを特徴とする請求項4〜8のいずれか一つに記載の生成プログラム。
The command execution log includes a character string indicating an execution start time of each of the plurality of commands and a character string indicating an execution end time,
In the computer,
Referring to the command execution log, for each command of the plurality of commands, based on the character string indicating the execution start time and the character string indicating the execution end time of the specified command, Calculate the time required for execution,
Calculate the total time calculated for the identified command,
Outputting the calculated total value in association with the program;
The generation program according to any one of claims 4 to 8, wherein the processing is executed.
コンピュータが、
コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行することを特徴とする生成方法。
Computer
Obtain a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation method characterized by executing processing.
コマンドと前記コマンドに対応付けられた引数とを含む実行履歴を記憶したコマンド実行ログを取得し、
コマンドが記憶されたコマンドリストを参照して、取得した前記コマンド実行ログから、前記実行履歴における前記コマンドと前記引数とを特定し、
特定した前記コマンドと、特定した前記引数を置き換えた変数とに基づいて、前記変数に設定される値を引数として前記コマンドを実行可能なプログラムを生成する、
処理を実行する制御部を有することを特徴とする生成装置。
Obtain a command execution log storing an execution history including a command and an argument associated with the command,
With reference to the command list in which the command is stored, from the acquired command execution log, the command and the argument in the execution history are specified,
Based on the identified command and a variable obtained by replacing the identified argument, a program that can execute the command with a value set in the variable as an argument is generated.
A generation apparatus comprising a control unit that executes processing.
JP2016200451A 2016-10-11 2016-10-11 GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE Pending JP2018063496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016200451A JP2018063496A (en) 2016-10-11 2016-10-11 GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016200451A JP2018063496A (en) 2016-10-11 2016-10-11 GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE

Publications (1)

Publication Number Publication Date
JP2018063496A true JP2018063496A (en) 2018-04-19

Family

ID=61966732

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016200451A Pending JP2018063496A (en) 2016-10-11 2016-10-11 GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE

Country Status (1)

Country Link
JP (1) JP2018063496A (en)

Similar Documents

Publication Publication Date Title
CN112231197A (en) Page testing method and device and storage medium
JP6996629B2 (en) Verification automation equipment, verification automation methods, and programs
CN106709985B (en) Virtual sacrifice three-dimensional scene generation method and device
US12001324B2 (en) Operation pattern generation apparatus, operation pattern generation method and program
WO2021100156A1 (en) Test data generation device, test data generation method, and program
JP5994693B2 (en) Information processing apparatus, information processing method, and information processing program
JP2018063496A (en) GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE
JP7073431B2 (en) Source code analysis system and source code analysis method
JP6025955B1 (en) Program analysis apparatus and program analysis method
JP2018022433A (en) Control program, apparatus, and method
JP2016173756A (en) Test case generation program, test case generation method, and test case generation device
CN110286894B (en) Script generation method, script generation device, computer equipment and storage medium
JP7380851B2 (en) Test script generation device, test script generation method and program
JP2019008799A (en) System and method for merging source data from source application into target data of target application
CN111045991B (en) Implementation method for quickly opening file based on command line mode
JP5971399B2 (en) Execution flow creation support program
JP5578625B2 (en) Program analysis apparatus, program analysis method, and program
JP5705681B2 (en) Information processing apparatus, data migration tool generation method and program
US8775873B2 (en) Data processing apparatus that performs test validation and computer-readable storage medium
CN111126012A (en) Method and device for generating expression in customization mode
JP6802109B2 (en) Software specification analyzer and software specification analysis method
JP6437396B2 (en) Trace information management system, method, and program
JP2016042317A (en) Software design support apparatus and method
JP7677542B2 (en) Determination device, determination method, and program
CN118606273A (en) Polyhedral mesh-based file conversion method and terminal device