Task Spooler

I wrote Task Spooler because I didn't have any comfortable way of running batch jobs in my linux computer. I wanted to:

You can look at an old (but representative) screenshot if you want.

Mailing list

Alessandro Öhler prepared a mailing list for discuting newer functionalities and interchanging use experiences. You can look at the archive or subscribe.

How it works

The queue is maintained by a server process. This server process is started if it isn't there already. The communication goes to a unix socket in /tmp/.

When the user requests a job (using a ts client), the client waits for the server message to know when it can start. The client usually forks, but it will run the command with the proper environment, because the client will run the job (not the server, like in 'at' or 'cron'). So, the ulimits, environment, pwd,. apply.

When the job finishes, the client notifies the server. At this time, the server may notify any waiting client, and stores the output and the errorlevel of the finished job.

Download

Download the latest version (GPLv2+ licensed): ts-0.5.tar.gz - v0.5

Look at the version repository if you are interested in its development.

Андрей Пантюхин (Andrew Pantyukhin) maintains the BSD port.

Alessandro Öhler provided a Gentoo ebuild for 0.4, but with a simple rename it becames a valid ebuild for 0.5.

I try to maintain Debian packages: ts_0.5_i386.deb. (warning, it conflicts with the binary also named 'ts' in the package 'moreutils')

Pascal Bleser packed the program for SuSE and openSuSE in RPMs for various platforms.

Manual

Look at its manpage (v0.5). Here you also have a copy of the help for the same version:

usage: ./ts [action] [-ngfmd] [-L <lab>] [cmd...]
Env vars:
  TS_SOCKET  the path to the unix socket used by the ts command.
  TS_MAILTO  where to mail the result (on -m). Local user by default.
  TS_MAXFINISHED  maximum finished jobs in the queue.
  TS_ONFINISH  binary called on job end (passes jobid, error, outfile, command).
  TS_ENV  command called on enqueue. Its output determines the job information.
  TS_SAVELIST  filename which will store the list, if the server dies.
Actions:
  -K       kill the task spooler server
  -C       clear the list of finished jobs
  -l       show the job list (default action)
  -t [id]  tail -f the output of the job. Last run if not specified.
  -c [id]  cat the output of the job. Last run if not specified.
  -p [id]  show the pid of the job. Last run if not specified.
  -o [id]  show the output file. Of last job run, if not specified.
  -i [id]  show job information. Of last job run, if not specified.
  -s [id]  show the job state. Of the last added, if not specified.
  -r [id]  remove a job. The last added, if not specified.
  -w [id]  wait for a job. The last added, if not specified.
  -u [id]  put that job first. The last added, if not specified.
  -U <id-id>  swap two jobs in the queue.
  -h       show this help
  -V       show the program version
Options adding jobs:
  -n       don't store the output of the command.
  -g       gzip the stored output (if not -n).
  -f       don't fork into background.
  -m       send the output by e-mail (uses sendmail).
  -d       the job will be run only if the job before ends well
  -L <lab> name this task with a label, to be distinguished on listing.

Thanks

Author: Lluís Batlle i Rossell, viric_at_vicerveza_dot_homeunix_dot_net