Manpage of TS
Section: User Commands (1)
Return to Main Contents
ts - task spooler. A simple unix batch system
ts [actions] [options] [command...]
will run by default a per user unix task queue. The user can add commands to
the queue, watch that queue at any moment, and look at the task results
(actually, standard output and exit error).
with a command will add that command to the queue, and calling it without
commands or parameters will show the task list.
When adding a job to ts, we can specify how it will be run and how will the
results be collected:
Do not store the standard output/error in a file at
- let it use the
file descriptors decided by the calling process. If it is not used, the
for the new task will be outputed to stdout.
Pass the output through gzip (only if
). Note that the output files will not
have a .gz extension.
Don not put the task into background. Wait the queue and the command run without
getting detached of the terminal. The exit code will be that of the command, and
if used together with -n, no result will be stored in the queue.
Mail the results of the command (output and exit code) to
, or to the
- -L <label>
Add a label to the task, which will appear next to its command when listing
the queue. It makes more comfortable distinguishing similar commands with
Run the command only if the command before finished well (errorlevel = 0). This new
task enqueued depends on the result of the previous command. If the task is not run,
it is considered as failed for further dependencies.
Instead of giving a new command, we can use the parameters for other purposes:
server for the calling client. This will remove the unix socket and
processes related to the queue. This will not kill the command being
run at that time.
It is not reliable to think that
will finish when the server is really killed. By now it is a race condition.
Clear the results of finished jobs from the queue.
Show the list of jobs - to be run, running and finished - for the current queue.
This is the default behaviour if
is called without options.
- -t [id]
Show the last ten lines of the output file of the named job, or the last
running/run if not specified. If the job is still running, it will keep on
showing the additional output until the job finishes. On exit, it returns the
errorlevel of the job, as in -c.
- -c [id]
Run the system's cat to the output file of the named job, or the last
running/run if not specified. It will block until all the output can be
sent to standard output, and will exit with the job errorlevel as in
- -p [id]
Show the pid of the named job, or the last running/run if not specified.
- -o [id]
Show the output file name of the named job, or the last running/run
if not specified.
- -s [id]
Show the job state of the named job, or the last in the queue.
- -r [id]
Remove the named job, or the last in the queue.
- -w [id]
Wait for the named job, or for the last in the queue.
- -u [id]
Make the named job (or the last in the queue) urgent - this means that it goes
forward in the queue so it can run as soon as possible.
- -i [id]
Show information about the named job (or the last run). It will show the command line,
some times related to the task, and also any information resulting from
TS_ENV (Look at ENVIRONMENT).
- -U <id-id>
Interchange the queue positions of the named jobs (separated by a hyphen and no
Show help on standard output.
Show the program version.
by default offers a queue where each job runs only after the previous finished.
Nevertheless, you can change the maximum number of jobs running at once with
parameter. We call that number the
amount of slots. You can also set the initial number of jobs with
the environment variable
When increasing this setting, queued waiting jobs will be run
at once until reaching the maximum set. When decreasing this setting, no other
job will be run until it can meet the amount of running jobs set.
may change a bit. For example, -t without jobid will tail the first
job running, and -d will try to set the dependency with the last job added.
- -S <num>
Set the maximum amount of running jobs at once.
Limit the number of job results (finished tasks) you want in the queue. Use this
option if you are tired of
If the variable exists pointing to an executable, it will be run by the client
after the queued job. It uses execlp, so
is used if there are no slashes in the variable content. The executable is run
with four parameters:
As the program output and the unix socket are thought to be stored in a
will be used if defined, or
Each queue has a related unix socket. You can specify the socket path with this
environment variable. This way, you can have a queue for your heavy disk
operations, another for heavy use of ram., and have a simple script/alias
wrapper over ts for those special queues. If it is not specified, it will be
Set the number of slots at the start of the server, similar to
but the contents of the variable are read only when running
the first instance of
Send the letters with job results to the address specified in this variable.
Otherwise, they are sent to
or if not defined,
is used. The
job outputs are not sent as an attachment, so understand the consequences if you
As seen above, it is used for the mail destination if
is not specified.
If it is defined when starting the queue server (probably the first
command run), on SIGTERM the queue status will be saved to the file pointed
by this environment variable - for example, at system shutdown.
This has a command to be run at enqueue time through
/bin/sh. The output of the command will be readable through the option
-i. You can use a command which shows relevant environment for the command run.
For example, you may use TS_ENV='pwd;set;mount'.
finds any internal problem, you should find an error report there.
Please send this to the author as part of the bug report.
expects a simple command line. It does not start a shell parser.
If you want to run complex shell commands, you may want to run them through
sh -c 'commands...'
Also, remember that stdin/stdout/stderr will be detached, so
do not use your shell's redirection operators when you put a job into background.
You can use them inside the
in order to set redirections to the command run.
If an internal problem is found in runtime, a file
is created, which you can submit to the developer in order to fix the bug.
Lluis Batlle i Rossell
This page describes
as in version 0.6.1. Other versions may differ. The file
found in the distribution package can show some ideas on special uses of
- SIMPLE USE
- COMMAND OPTIONS
- SEE ALSO
This document was created by
using the manual pages.
Time: 23:22:46 GMT, November 02, 2008