cp、mvの現在状況を確認出来る『cv』コマンド
Pocket

いままで、パフォーマンスやネットワークのモニタリングコマンドについて扱ってきたが、今回はcpやmvプロセスのモニタリングコマンド『cv』について紹介する。
このコマンドは、OS上で実行されているcpやmvの実行状況(何%終了したか等)を確認することが出来る。

1.インストール

以下のコマンドを実行し、『cv』コマンドをインストールする。

$ git clone https://github.com/Xfennec/cv
$ cd cv
$ make
$ sudo make install

これでインストールできた。

2.コマンド実行

インストールは出来たので、次は実際にコマンドを実行してみよう。
まずはヘルプの内容を出力。

$ $ cv --help
cv - Coreutils Viewer
---------------------
Shows running coreutils basic commands and displays stats.
Supported commands: cp mv dd tar gzip gunzip cat grep fgrep egrep cut sort
Usage: cv [-vqwmMh] [-W] [-c command]
-v --version show version
-q --quiet hides all messages
-d --debug shows all warning/error messages
-w --wait estimate I/O throughput and ETA (slower display)
-W --wait-delay secs wait 'secs' seconds for I/O estimation (implies -w, default=1.0)
-m --monitor loop while monitored processes are still running
-M --monitor-continous like monitor but never stop (similar to watch cv)
-h --help this message
-c --command cmd monitor only this command name (ex: firefox)

ほうほう、どうやらモニタモードとか、監視するコマンドの指定を出来るようだ。
実際にcpコマンドを叩いて、このコマンドを実行してみよう。

$ cv

20140907_000006

現在のcpコマンドの進捗具合が表示された。
とはいえ、これだと一回こっきりなのでモニタリングモードで継続的に監視してみよう。

$ cv -m

20140907_000007

うん、これで継続監視が出来るようになった。
cpとかやったはいいけど、いつ終わるのかわからなくなった場合に重宝するかも?

Written by blacknon

インフラ系のSE。一時期はプログラマ。 仮想化とオープンソースに興味あり。一日中寝てたい今日このごろ。 スペインとかで働きたいなぁ…(シエスタがあるので)

Leave a Comment

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>