簡単なキュー登録による複数タスクのバッチ処理を可能にするTask Spooler

 Task Spoolerは、バッチ処理させたいタスク群をシェルからキュー(待ち行列)に直接登録するためのユーティリティだ。その使用法は簡単で、特別な設定も必要とせず、またキューに登録したコマンドの確認と編集も行える他、こうしたコマンド群からの出力も随時確認できるようになっている。


 Task SpooleratTask SpooleratatTask SpoolerTask Spooler

 FedoraopenSUSEUbuntuTask SpoolerDebianUbuntuopenSUSE 10.x稿Task Spooler0.664Fedora 9Task Spoolerautotools使make; sudo make installTask Spoolertsman/usr/local

 Task Spooler12tsts -cstdout-ccatts -its -C使
$ ts echo "hello world"
6

$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=0/1]
6    finished   /tmp/ts-out.QoKfo9   0        0.00/0.00/0.00 echo hello world

$ ts -c 6
hello world

$ ts -i 6
Command: echo hello world
Enqueue time: Tue Jul 22 14:42:22 2008
Start time: Tue Jul 22 14:42:22 2008
End time: Tue Jul 22 14:42:22 2008
Time run: 0.003336s

 tail -f-t使-mtartar
$ ts tar czvf /tmp/mytarball.tar.gz liberror-2.1.80011
11
$ ts notify-send "tarball creation" "the long running tar creation process is complete."
12
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=0/1]
11   finished   /tmp/ts-out.O6epsS   0        4.64/4.31/0.29 tar czvf /tmp/mytarball.tar.gz liberror-2.1.80011
12   finished   /tmp/ts-out.4KbPSE   0        0.05/0.00/0.02 notify-send tarball creation the long... is complete.

 run=0/1Task Spooler01Task SpoolerCPU-S
$ ts -S 2
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=0/2]
6    finished   /tmp/ts-out.QoKfo9   0        0.00/0.00/0.00 echo hello world

 Task Spooler21CPUTask Spooler3121tstsbash使2ts-d128228Task Spooler2
$ ts bash -c "sleep 10; echo hi"
28
$ ts -d echo there
29
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=1/2]
28   running    /tmp/ts-out.hKqDva                           bash -c sleep 10; echo hi
29   queued     (file)                                       && echo there
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=0/2]
28   finished   /tmp/ts-out.hKqDva   0        10.01/0.00/0.01 bash -c sleep 10; echo hi
29   finished   /tmp/ts-out.VDtVp7   0        0.00/0.00/0.00 && echo there
$ cat /tmp/ts-out.hKqDva
hi
$ cat /tmp/ts-out.VDtVp7
there

 1tsIDID22IDIDts&&21

 1sleep2ts112
$ FIRST_TASKID=`ts bash -c "sleep 10; echo hi"`
$ ts sh -c "ts -w $FIRST_TASKID && echo there"
25
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=2/2]
24   running    /tmp/ts-out.La9Gmz                           bash -c sleep 10; echo hi
25   running    /tmp/ts-out.Zr2n5u                           sh -c ts -w 24 && echo there
$ ts
ID   State      Output               E-Level  Times(r/u/s)   Command [run=0/2]
24   finished   /tmp/ts-out.La9Gmz   0        10.01/0.00/0.00 bash -c sleep 10; echo hi
25   finished   /tmp/ts-out.Zr2n5u   0        9.47/0.00/0.01 sh -c ts -w 24 && echo there
$ ts -c 24
hi
$ ts -c 25
there


 Task Spoolerts1attail -fTask SpoolerCPU

 11

 Ben Martin10libferris 

Linux.com 2008812