JP2018063496A - GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE - Google Patents
GENERATION PROGRAM, GENERATION METHOD, AND GENERATION DEVICE Download PDFInfo
- 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
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.
しかしながら、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.
以下に添付図面を参照して、本発明にかかる生成プログラム、生成方法、および生成装置の実施の形態を詳細に説明する。 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
ここで、コマンドとは、コンピュータに指示する特定の文字列である。コマンドを実行するとは、コマンドによって定められた処理を管理対象のサーバなどのコンピュータが実行することである。引数は、コマンドの動作を決定するためにコマンドに付加される数値や文字である。また、引数は、例えば、コマンドの実行に使用されるファイル名や出力されるメッセージなどを指定するためにコマンドに付加される数値や文字である。引数は、コマンドに対応付けて入力される。例えば、引数は、「コマンド 引数」のようにコマンドにつづいてスペース区切りで入力される。また、引数が複数ある場合、各引数は、「コマンド 引数 引数」のようにスペース区切りで入力される。ここで、コマンドの動作を決定するための数値や文字である引数については、オプションとも称する。 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
まず、生成装置100は、コマンド実行ログ101を取得する。コマンド実行ログ101は、コマンドとコマンドに対応付けて入力された引数とを含む実行履歴が記憶される。コマンド実行ログ101に含まれる実行履歴は、管理者の操作入力により実行されたコマンドや、過去に自動実行されたコマンドの実行履歴である。図1の例では、コマンド実行ログ101は、1つのコマンドに関するログであるが、これに限らず、連続して実行された複数のコマンドが含まれていてもよい。取得方法としては、生成装置100は、例えば、自装置が有する記憶装置から読み出すことによりコマンド実行ログ101を取得してもよいし、外部装置からネットワークなどを介して取得してもよい。
First, the
つぎに、生成装置100は、コマンドリスト102を参照して、取得したコマンド実行ログ101から、実行履歴におけるコマンドと引数とを特定する。コマンドリスト102には、コマンドが記憶されてある。図1の例では、コマンドリスト102には、コマンド「deploy」が含まれる。
Next, the
ここで、実行履歴におけるコマンドと引数とを特定する方法として、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
また、2つ目の方法としては、生成装置100は、例えば、コマンド実行ログ101から、コマンドリスト102を参照して、コマンドを特定する。そして、生成装置100は、特定したコマンドに基づいて、コマンドにスペース区切りで入力された文字列を引数として特定してもよい。
As a second method, for example, the
図1の例では、生成装置100は、実行部分111におけるコマンド「deploy」と引数「Server01」とを特定する。
In the example of FIG. 1, the
つぎに、生成装置100は、特定したコマンドと、特定した引数を置き換えた変数と、に基づいて、変数に設定される値を引数として特定したコマンドを実行可能なプログラムを生成する。ここで生成されるプログラムは、プログラミング言語の1種であるスクリプト言語で記載されたプログラムであるため、シェルスクリプト103とも称する。シェルスクリプト103の生成方法としては、生成装置100は、シェルスクリプト103の雛形のデータとなるテンプレートファイルに、コマンドと、引数を置き換えた変数と、を含む実行部分を追加することによりシェルスクリプト103を生成してもよい。また、生成装置100は、生成するプログラムとして、テンプレートファイルに、コマンドと、引数を置き換えた変数と、を含む実行部分を追加することにより得られたシェルスクリプトをコンパイルして得られた実行ファイルを生成してもよい。
Next, the generating
ここで、引数を変数に置き換える際に、生成装置100は、値の異なる引数が異なる変数となるように置き換える。また、引数を変数に置き換える際に、生成装置100は、値の同じ引数が同じ変数となるように置き換える。引数を変数に置き換える方法としては、生成装置100は、例えば、引数を、変数であることを示す「$」に変数名を付加させた「$変数名」に置き換える。生成装置100は、例えば、環境変数の命名規則の慣例に従って、引数の値を大文字に変更した文字列を変数名としてもよい。図1の例では、実行部分112は、コマンド「Deploy」と、引数「Server」が置き換えられた変数「$SERVER01」とを含む。そして、生成装置100は、実行部分112を含むシェルスクリプト103を生成する。これにより、管理者は、シェルスクリプト103を参照することにより、引数がどの変数に置き換えられたかが分かる。また、生成装置100は、例えば、特定した引数のうち、上述したオプション以外の引数を変数に置き換えるが、オプションを変数に置き換えなくてもよい。
Here, when replacing the argument with a variable, the generating
また、管理者は、シェルスクリプト103の作成の手間を省くことができる。さらに、管理者は、シェルスクリプト103内の変数に引数の値を与えて管理対象のサーバにシェルスクリプト103を実行させるだけで、管理者は、過去に行った作業を簡単に繰り返すことができる。
In addition, the administrator can save time and labor for creating the
(生成装置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
CPU201と、ROM202と、RAM203と、ディスクドライブ204と、I/F206とは、バス200によってそれぞれ接続される。
The
ここで、CPU201は、生成装置100等の全体の制御を司る。ROM202は、各種プログラムを記憶する。ROM202に記憶されるプログラムは、CPU201にロードされることにより、コーディングされている処理をCPU201に実行させる。RAM203はCPU201のワークエリアとして使用される。
Here, the
I/F206は、通信回線を通じてネットワーク207に接続される。そして、I/F206は、ネットワーク207を介して他の装置に接続される。そして、I/F206は、ネットワーク207と内部のインターフェースを司り、他のコンピュータからのデータの入出力を制御する。I/F206には、例えば、モデムやLAN(Local Area Network)アダプタなどを採用することができる。
The I /
ディスクドライブ204は、CPU201の制御に従ってディスク205に対するデータのリード/ライトを制御する。ディスク205は、ディスクドライブ204の制御で書き込まれたデータを記憶する。ディスク205としては、例えば、磁気ディスク、光ディスクなどが挙げられる。
The
また、生成装置100は、上述した構成部のほか、例えば、SSD(Solid State Drive)、キーボードやマウスなどの入力装置、ディスプレイなどの出力装置を有することにしてもよい。
In addition to the components described above, the
また、生成装置100は、キーボードやマウスなどの入力装置、ディスプレイなどの出力装置などを有するPCや端末装置とネットワークを介して接続されていてもよい。そして、管理者は、このPCや端末装置に対する操作入力によって生成装置100のコマンドプロンプトに対してコマンド入力を行ってもよい。
The
また、本実施の形態では、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
記憶部310は、例えば、ROM202、RAM203、ディスク205などによって実現される。記憶部310は、例えば、コマンド実行ログ311、コマンドリスト312、テンプレートファイル313、コマンドマニュアル情報314などを有する。
The
コマンド実行ログ311は、所定の作業を行うために連続して実行された複数のコマンドのログである。コマンド実行ログ311は、図1に示したコマンド実行ログ101のより詳細な例である。コマンド実行ログ311は、図4に一例を示す。コマンドリスト312は、複数のコマンドのそれぞれについて、コマンドと、コマンドに関するコメント情報と、を対応付けて記憶する。コメント情報とは、コマンドの説明のための文字列であり、コンピュータに指示できない文字列である。コマンドリスト312は、図1に示したコマンドリスト102のより詳細な例である。コマンドリスト312は、図5に一例を示す。
The
テンプレートファイル313は、生成されるシェルスクリプトのテンプレートである。テンプレートファイル313は、図6に一例を示す。コマンドマニュアル情報は、コマンドごとに、コマンドに付加可能なオプションを示す。生成装置100は、コマンドマニュアル情報を用いて、コマンドに対応付けられた引数を、オプションと、オプション以外の引数とに区別させることができる。
The
図4は、コマンド実行ログ例を示す説明図である。コマンド実行ログ311は、所定の作業を行うために実行されたコマンドのログである。コマンド実行ログ311は、例えば、生成装置100が実行したコマンドのログであってもよいし、他の装置が実行したコマンドのログであってもよい。
FIG. 4 is an explanatory diagram illustrating an example of a command execution log. The
コマンド実行ログ311には、実行されたコマンドごとに、コマンドの実行開始時刻を示す文字列およびコマンドを含む行と、コマンドの実行終了時刻を示す文字列およびコマンドを含む行と、が含まれる。ここで、日時や時刻を示す文字列をタイムスタンプと称する。コマンドの実行開始時刻を示す文字列は、開始タイムスタンプと称する。コマンドの実行終了時刻を示す文字列は、終了タイムスタンプと称する。ここで、タイムスタンプの後ろに、「START」が付加されていれば、タイムスタンプは、開始タイムスタンプである。また、タイムスタンプの後ろに、「END」が付加されていれば、タイムスタンプは、終了タイムスタンプである。
The
コマンド実行ログ311は、コマンドの実行順に実行履歴が並べられてある。図4の例では、コマンド実行ログ311は22行ある。コマンド実行ログ311の奇数行には、開始タイムスタンプおよびコマンドを含む行が含まれる。コマンド実行ログ311の偶数行には、終了タイムスタンプおよびコマンドを含む行が含まれる。
The
図5は、コマンドリスト例を示す説明図である。コマンドリスト312は、各コマンドと、各コマンドに関するコメント情報とを対応付けて記憶する。コマンドリスト312には、コマンド、シェル用コメント情報、オプション用コメント情報のフィールドを有する。コマンドリスト312は、各フィールドに情報が設定されることにより、レコード(例えば、500−1〜500−6)などが記憶される。
FIG. 5 is an explanatory diagram illustrating an example of a command list. The
コマンドのフィールドには、サーバで使用可能なコマンドが設定される。シェル用コメント情報のフィールドには、生成されるシェルスクリプトにおいて、コマンドに対応付けられるコマンドに関するコメント情報が設定される。シェル用コメント情報は、生成されるシェルスクリプトにおいてコマンドに対応付けられるコメント情報である。オプション用コメント情報のフィールドには、生成されるオプション情報において、コマンド実行ログ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
レコード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
テンプレートファイル313の2行目には、生成されるオプション情報を呼び出すための命令文が含まれる。2行目の「optioninfo」は後述するオプション情報のファイル名である。オプション情報のファイル名を予め決めておくことにより、テンプレートファイル313からシェルスクリプトを生成する際の変更が少なくなる。これにより、オプション情報と生成されるシェルスクリプトを関連付けることができる。
The second line of the
テンプレートファイル313の3行目には、コマンド全体の実行に要する時間を出力し、コマンドの実行の要否を確認するための出力文が含まれる。
The third line of the
テンプレートファイル313の4行目には、実行の要否の入力を受け付ける受付文が含まれる。ここでは、「y」を受け付けると、コマンドが実行され、「n」を受け付けると、コマンドが実行されない。テンプレートファイル313の5行目には、受け付けた情報が何であるかを判別する判定文が含まれる。
The fourth line of the
テンプレートファイル313の6行目には、「y」が入力された場合における分岐文が含まれる。テンプレートファイル313の7行目には、実行が完了したことを出力する出力文が含まれる。ここで、テンプレートファイル313の6行目と7行目の間に、コマンドが追加される。
The sixth line of the
また、テンプレートファイル313の9行目には、「n」が入力された場合における分岐文が含まれる。テンプレートファイル313の10行目には、実行がキャンセルされたことを出力する出力文が含まれる。
Further, the ninth line of the
なお、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
つぎに、抽出部302は、コマンドリスト312を参照して、取得部301によって取得されたコマンド実行ログ311から、実行履歴におけるコマンドと引数とを特定する。また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合、抽出部302は、コマンドリスト312を参照して、複数のコマンドのそれぞれのコマンドについて、コマンドとコマンドに対応付けて入力された引数とを特定する。ここで、コマンドと引数とを特定する具体的な方法としては、2つの方法が挙げられる。
Next, the
1つ目の特定方法としては、抽出部302は、例えば、コマンドリスト312を参照して、取得部301によって取得されたコマンド実行ログ311から、コマンドを特定することにより、コマンドとコマンドに対応付けて入力された引数と、を特定する。より具体的には、抽出部302は、例えば、コマンド実行ログ311に含まれる先頭の行から終端の行までを順に読み込む。そして、抽出部302は、読み込んだ各行について、コマンドリスト312に記憶されたコマンドを特定する。そして、抽出部302は、各行について、特定したコマンドの直前に記述された「asadmin」と、コマンドと、コマンドより後に記述された内容と、を含む部分を実行部分として抽出する。そして、抽出部302は、抽出した実行部分のうち、コマンド以降に記述された内容をコマンドに対応付けて入力された引数として特定する。
As a first specifying method, for example, the
2つ目の特定方法としては、抽出部302は、例えば、コマンド実行ログ311に含まれる各行について、予め決められた部分以外の部分を実行部分として抽出する。図4において、予め決められた部分とは、例えば、始タイムスタンプまたは終了タイムスタンプを含み、「START」または「END( )」よりも前の部分である。開これにより、抽出部302は、コマンド実行ログ311から、予め決められた部分を削除した残りの部分を実行部分として抽出する。抽出部302は、コマンドリスト312を参照して、抽出した実行部分から、コマンドを特定する。そして、抽出部302は、抽出した実行部分のうち特定したコマンド以降に記述された内容を引数として特定する。
As a second specifying method, for example, the
また、図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
図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
また、算出部305は、コマンド実行ログ311に含まれる複数のコマンドのそれぞれのコマンドについて、開始タイムスタンプおよび終了タイムスタンプに基づいて、コマンドの実行に要した処理時間を算出する。
Further, the
また、算出部305は、複数のコマンドのそれぞれのコマンドについて算出した処理時間の合計値を、シェルスクリプトに含まれる複数のコマンドの実行に要する合計処理時間として算出する。
Further, the
つぎに、図3に示す第1生成部303は、特定したコマンドと、特定した引数を置き換えた変数とを含む実行部分に基づいて、変数に設定される値を引数として特定したコマンドを実行可能なプログラムを生成する。プログラムは上述したようにシェルスクリプトである。第1生成部303によって生成されたシェルスクリプトは、例えば、記憶部310などに記憶される。
Next, the
また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合における第1生成部303によるシェルスクリプトの生成処理について説明する。第1生成部303は、特定したコマンドと特定した引数を置き換えた変数とを含む実行部分を、複数のコマンドの実行順に従って特定したコマンドを実行可能なシェルスクリプトを生成する。
Also, shell script generation processing by the
ここで、複数のコマンドの実行順の特定方法は、例えば、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
上述した抽出部302は、コマンド実行ログ311の先頭行からコマンドの実行順に実行部分を抽出している。このため、実行部分700には、コマンドの実行順に先頭から複数のコマンドが並んでいる。このため、第1生成部303は、実行部分700におけるコマンドの並びをそのまま利用してシェルスクリプトを生成すればよい。
The
具体的には、第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
また、第1生成部303は、特定した引数のうちの同一値の引数を同一の変数に置き換えたシェルスクリプトを生成する。引数が同一値であるとは、引数として同じ文字列が設定されていることを示す。例えば、実行部分700において、先頭から2番目のコマンドに対応付けられた引数「IJServer005」は、先頭から4番目に対応付けられた2つ目の引数と、先頭から5番目に対応付けられた引数と、同じである。このため、第1生成部303は、実行部分700に含まれる各実行部分のうちの引数「IJServer005」を同じ変数「$IJSERVER005」に置き換える。これにより、管理者は、同じ引数を一括で設定することができるため、シェルスクリプトを簡単に実行させることができる。
In addition, the
また、第1生成部303は、コマンドマニュアル情報314に基づいて、抽出部302によって特定された引数のうち、オプション以外の引数を特定する。そして、第1生成部303は、オプション以外の引数を変数に置き換える。第1生成部303は、オプションについては変数に置換しなくてよい。
Further, the
また、第1生成部303は、シェルスクリプトに追加した複数のコマンドのそれぞれについて、コマンドリスト312から、コマンドに対応付けられたシェル用コメント情報を取得する。そして、第1生成部303は、シェルスクリプトに追加したコマンドに取得したシェル用コメント情報を関連付ける。
Further, the
また、第1生成部303は、シェルスクリプトに追加した複数のコマンドのそれぞれについて、算出部305によって算出された処理時間を関連付けて出力する。具体的には、第1生成部303は、例えば、シェルスクリプトに追加したコマンドに関するコメント情報として、算出部305によって算出された処理時間を示す文字列をシェルスクリプトに追加する。
The
また、第1生成部303は、シェルスクリプトに、算出部305によって算出された合計処理時間を関連付けて出力する。具体的には、第1生成部303は、例えば、シェルスクリプトに、算出部305によって算出された合計処理時間を出力する出力文を追加する。また、第1生成部303は、例えば、シェルスクリプトに、コメント情報として、算出部305によって算出された合計処理時間を示す文字列を追加する。
The
図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
また、シェルスクリプト800では、7行目から28行目に実行部分700が追加される。ここで、シェルスクリプト800において、「#」以降の文字列は、コメント情報である。また、(7+i)行目のコメント情報は、(8+i)行目のコマンドについて取得されたシェル用コメント情報および算出された処理時間を示す文字列を含む。iは、0以上の整数である。シェルスクリプト800によれば、19行目のコメント情報により、20行目に含まれる「asadmin create−cluster $IJSERVER007」がインスタンスの作成に関するコマンドであり、処理時間が約13秒であることが分かる。このように、管理者は、各コマンドによりどのような処理が実行されるかを把握することができ、各コマンドの作業時間の目安を付けることができる。
In the
また、シェルスクリプト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
また、図3の説明に戻って、第2生成部304は、例えば、変数と、特定された引数と、を対応付けた対応情報を生成する。ここで、対応情報については、オプション情報とも称する。オプション情報のファイル名は、上述したように「оptiоninfо」とする。このように、引数と変数とを対応付けてリスト化することにより、変数の元となる引数が分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。上述したように、コマンドリスト312は、コマンドと、コマンドに関するコメント情報と、を対応付けて記憶してある。ここでのコマンドに関するコメント情報は、上述したオプション用コメント情報である。第2生成部304は、コマンドリスト312を参照して、変数と、特定された引数と、特定された引数に対応するコマンドに対応付けられたコメント情報と、を対応付けたオプション情報を生成する。これにより、変数の元となる引数が、いずれのコマンドに対応付けて入力された引数であるかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。
Returning to the description of FIG. 3, the
また、コマンド実行ログ311に連続して実行された複数のコマンドが含まれる場合における第2生成部304によるオプション情報の生成処理について説明する。第2生成部304は、コマンドリスト312を参照して、複数のコマンドのそれぞれのコマンドについて特定した引数と変数との組み合わせを引数に対応するコマンドの実行順に従って並べたオプション情報を生成する。すなわち、生成されるオプション情報では、コマンド実行ログ311における先頭行からの引数の出現順に引数と変数との組み合わせが並べられる。複数のコマンドの実行順の特定方法は、例えば、上述した2つの方法であり、詳細な説明を省略する。
An option information generation process performed by the
また、第1生成部303において同一値の引数が同一の変数に置き換えられた場合における第2生成部304によるオプション情報の生成処理について説明する。第2生成部304は、例えば、コマンドリスト312を参照して、変数と引数との組み合わせについて、引数に対応するコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に従って並べたコメント情報群を対応付けたオプション情報を生成する。すなわち、生成されるオプション情報では、変数と引数との組み合わせについて、コマンド実行ログ311における先頭行からのコマンドの出現順にコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に並べられる。
An option information generation process performed by the
図9は、オプション情報例を示す説明図である。オプション情報900は、変数と、引数と、引数を含む実行部分におけるコマンドに対応付けられたコメント情報と、を対応付けて記憶する。また、変数は、コマンド実行ログ311における引数の出現順に並べられてある。コマンド実行ログ311はコマンドの実行順に並んでいるため、引数の出現順とは、引数を対応付けられたコマンドの実行順である。
FIG. 9 is an explanatory diagram illustrating an example of option information. The
オプション情報900において、「#」以降の文字列は、コメント情報である。例えば、変数「$IJSERVER005」は、引数「IJServer005」を置き換えた変数である。そして、引数「IJServer005」は、コマンド実行ログ311において、「クラスタを作成」、「インスタンスを作成」、「アプリケーションを配備」、「クラスタを起動」のそれぞれに対応するコマンドに対応付けられてある。上述したように、各変数において、コメント情報は、上述したように、コマンドの実行順に並べられてある。
In the
上述したように、図8に示すシェルスクリプト800の2行目には、sоurceコマンドと、オプション情報900のファイル名と、が含まれる。これにより、管理対象のサーバが、シェルスクリプト800を実行すると、オプション情報900が呼び出される。このように、オプション情報900とシェルスクリプト800とは関連付けられてある。
As described above, the source command and the file name of the
したがって、管理者は、オプション情報900内の引数を書き換えることによりまとめて変数に引数を設定することができる。
Therefore, the administrator can collectively set arguments to variables by rewriting the arguments in the
(生成装置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
一方、取得部301は、記憶部310にコマンドリスト312が存在しないと判断した場合(ステップS1001:No)、コマンドリスト312を取得する(ステップS1002)。ステップS1002において、取得部301は、ネットワーク207を介して他の装置からコマンドリスト312を取得してもよいし、入力装置(図示省略)に対する管理者の操作入力などによってコマンドリスト312を取得してもよい。
On the other hand, when determining that the
また、抽出部302は、コマンド実行ログ311から、コマンドリスト312に基づいて、コマンドと引数とを含む実行部分を抽出する(ステップS1003)。ステップS1003において、抽出部302は、コマンド実行ログ311から、コマンドリスト312に基づいて、コマンドと引数とを特定することにより、実行部分を抽出する例を挙げている。このため、抽出された実行部分においてコマンドと引数とは特定されてある。上述したように、ステップS1003に記載の処理に代わって、抽出部302は、コマンド実行ログ311から実行部分を抽出した後に、抽出した実行部分からコマンドリスト312に基づいてコマンドと引数を特定する処理を行ってもよい。
Further, the
つぎに、第1生成部303は、テンプレートファイル313に、抽出した実行部分を追加したシェルスクリプトを生成する(ステップS1004)。そして、第1生成部303は、コマンドリスト312から、抽出した実行部分に含まれるコマンドに対応付けられた各コメント情報を取得する(ステップS1005)。ステップS1005において取得されるコメント情報は、コマンドリスト312に含まれるスクリプト用コメント情報およびオプション用コメント情報である。
Next, the 1st production |
つぎに、第1生成部303は、シェルスクリプト800に、複数のコマンドのそれぞれのコマンドについて取得したスクリプト用コメント情報を追加する(ステップS1006)。ステップS1006において、第1生成部303は、図8に示すように、シェルスクリプト800に含まれる複数のコマンドのそれぞれに対応付けて取得したスクリプト用コメント情報を追加する。
Next, the
つぎに、算出部305は、コマンド実行ログ311に基づいて、実行された複数のコマンドのそれぞれのコマンドの処理時間を算出する(ステップS1101)。つづいて、算出部305は、それぞれのコマンドについて算出した処理時間を合計することにより合計処理時間を算出する(ステップS1102)。そして、第1生成部303は、実行されたコマンドごとに算出した処理時間を示す文字列をシェルスクリプト800に追加する(ステップS1103)。ステップS1103において、第1生成部303は、シェルスクリプト800内のコマンドごとに算出した処理時間を対応付けて出力する。
Next, the
つぎに、第1生成部303は、シェルスクリプト800に、合計処理時間を追加する(ステップS1104)。ステップS1104において、合計処理時間を追加する処理としては、第1生成部303は、例えば、合計処理時間を出力する出力文をシェルスクリプト800に追加する。テンプレートファイル313には、合計処理時間を出力するための出力文が記述されているため、ステップS1104において、合計処理時間を追加する処理としては、第1生成部303は、算出した合計処理時間を示す文字列を出力文に追加する。
Next, the
つづいて、第1生成部303は、コマンドマニュアル情報314に基づいて、シェルスクリプト800において引数を変数に置換する(ステップS1105)。ステップS1105において、第1生成部303は、コマンドマニュアル情報314に基づいて、特定された各引数のうちオプション以外の引数を特定する。そして、ステップS1105において、第1生成部303は、オプション以外の引数を、「$」と引数を大文字にした文字列との組み合わせの文字列に置換する。「$文字列(変数名)」によって変数が表される。引数を大文字にした文字列を変数とすることにより、シェルスクリプト800に含まれる各引数のうちの同一値の引数を同一の変数に置き換えることができる。ここで、引数に数値が含まれる場合、数値を文字列として変数とする。
Subsequently, the
つぎに、第2生成部304は、コマンドの実行順に、変数と、引数と、コマンドに対応付けられたオプション用コメント情報とを対応付けたオプション情報900を生成する(ステップS1106)。そして、第2生成部304は、オプション情報900において、オプション用コメント情報をコマンドの実行順に並べ(ステップS1107)、一連の処理を終了する。なお、第2生成部304は、ステップS1106とステップS1107とを同時に行ってもよい。
Next, the
以上説明したように、生成装置100は、コマンドリストを参照してコマンド実行ログ内の実行履歴におけるコマンドと引数とを特定し、コマンドと引数を置換した変数とに基づきシェルスクリプトを生成する。これにより、管理者は、シェルスクリプトの作成の手間を省くことができる。また、管理者は、シェルスクリプト内の変数に引数の値を与えて管理対象のサーバにシェルスクリプトを実行させるだけで、過去に行った作業を簡単に繰り返し行うことができる。したがって、生成装置100は、管理者がコマンドを何度も入力する手間を省くことができる。
As described above, the
また、生成装置100は、引数と変数とを対応付けてリスト化する。これにより、変数の元となる引数が分かり易いため、管理者は、変数に新たな引数を設定しやすくなる。
In addition, the
また、生成装置100は、コマンドにコメント情報を対応付けられたコマンドリストを参照して、変数と、引数と、引数に対応するコマンドに対応付けられたコメント情報と、を対応付けてリスト化する。これにより、変数が、シェルスクリプトにおいていずれのコマンドに対応付けられているかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。
In addition, the
また、生成装置100は、コマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含むコマンド実行ログを参照して算出したコマンドの処理時間をコマンドおよび変数に関連付けて出力する。これにより、管理者は、新たにコマンドをサーバに実行させる際のコマンドの処理時間の目安を付けることができる。
The
また、生成装置100は、連続して実行された複数のコマンドの各々について特定したコマンドと特定した引数を置き換えた変数とに基づいて、複数のコマンドの実行順に従って特定したコマンドを実行可能なシェルスクリプトを生成する。これにより、シェルスクリプトの作成の手間を省くことができる。また、コマンド群を何度も入力する手間を省くことができ、作業を容易に繰り返すことができる。
Further, the
また、生成装置100は、コマンドリストを参照して、複数のコマンドのそれぞれのコマンドについて、特定した引数と、変数と、対応付けてリスト化する。これにより、管理者は、リスト化されたファイルにより変数に引数を一括して設定することができるため、シェルスクリプトを実行し易くなる。
In addition, the
また、生成装置100は、引数に対応するコマンドの実行順に引数と変数とを対応付けてリスト化する。これにより、管理者は、一連のコマンドによる作業内容を理解し易くなる。
Further, the
また、生成装置100は、コマンドに関するコメント情報が対応付けられたコマンドリストを参照して、変数と、特定した引数と、特定した引数に対応するコマンドに対応付けられたコメント情報と、を対応付けてリスト化する。これにより、変数がいずれのコマンドに対応付けられているかが分かり易くなり、管理者は、変数に新たな引数を設定しやすくなる。
Further, the generating
また、生成装置100は、同一値の引数を同じ変数に置き換え、変数と特定した引数との組み合わせに、特定した引数に対応するコマンドに対応付けられたコメント情報を、複数のコマンドの実行順に並べたコメント情報群を対応付けてリスト化する。これにより、同一値の引数を一括して変更することができるため、管理者による引数の設定の手間を省くことができる。また、コメント情報をコマンドの実行順に並べることにより、管理者は、シェルスクリプトおよび変数と引数とのリストを参照した際に、一連のコマンドによる作業内容が理解し易くなる。
Further, the
また、生成装置100は、複数のコマンドのそれぞれのコマンドの実行開始時刻を示す文字列および実行終了時刻を示す文字列を含むコマンド実行ログを参照して、それぞれのコマンドの処理時間を合計することにより複数のコマンドの処理時間を算出する。これにより、管理者は、シェルスクリプトの処理時間の目安を付けることができる。
Further, the
また、生成装置100は、特定した引数のうち、オプション以外の引数を変数に置き換える。これにより、シェルスクリプトの実行時に変更する引数が変数に置き換わり、変更しなくてもよい引数が変数に置き換わらないため、管理者は、変数に新たな引数を設定しやすくなる。
In addition, the generating
なお、本実施の形態で説明した生成方法は、予め用意された生成プログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本生成プログラムは、磁気ディスク、光ディスク、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
(付記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
(付記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
(付記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
(付記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
(付記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
(付記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
(付記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
(付記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
(付記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
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.
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) |
-
2016
- 2016-10-11 JP JP2016200451A patent/JP2018063496A/en active Pending
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 |