SYNOPSIS

       ts [actions] [options] [command...]

       Actions: [-KCLhV] [-t [id]] [-c [id]] [-p [id]] [-o [id]] [-s [id]] [-r
       [id]] [-w [id]] [-u [id]] [-U <id-id>]

       Options: [-nfgm]



DESCRIPTION

       ts 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).


SIMPLE USE

       Calling ts with a command will add that command to the queue, and call-
       ing it without commands or parameters will show the task list.


COMMAND OPTIONS

       When adding a job to ts, we can specify how it will be run and how will
       the results be collected:

       -n     Don't store the standard output/error in a file at $TMPDIR - let
              it  use  the file descriptors decided by the calling process. If
              it is not used, the jobid for the new task will be  outputed  to
              stdout.

       -g     Pass the output through gzip (only if -n ). Note that the output
              files will not have a .gz extension.

       -f     Don't put the task into background. Wait the queue and the  com-
              mand 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.

       -m     Mail  the  results  of  the  command  (output  and exit code) to
              $TS_MAILTO , or to the $USER using /usr/sbin/sendmail.  Look  at
              ENVIRONMENT.


ACTIONS

       Instead  of  giving  a new command, we can use the parameters for other
       purposes:

       -K     Kill the ts server for the calling client. This will remove  the
              unix  socket and all the ts processes related to the queue. This
              will not kill the command being run at that time.

              It's not reliable to think that  ts  -K  will  finish  when  the
              server is really killed. By now it's a race condition.

       -C     Clear the results of finished jobs from the queue.

              specified.

       -o [id]
              Show the output file name of the named job,  or  the  last  run-
              ning/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.

       -U <id-id>
              Interchange  the queue positions of the named jobs (separated by
              a hyphen and no spaces).

       -h     Show help on standard output.

       -V     Show the program version.


ENVIRONMENT

       TS_MAXFINISHED
              Limit the number of job results (finished tasks) you want in the
              queue. Use this option if you're tired of -C.

       TS_ONFINISH
              If the variable exists pointing to an executable, it will be run
              after the queued jobs. It uses execlp, so PATH is used if  there
              are  no  slashes  in the variable content. The executable is run
              with four parameters: jobid errorlevel output_filename and  com-
              mand.

       TMPDIR As  the  program  output  and  the unix socket are thought to be
              stored in a temporary directory, TMPDIR will be used if defined,
              or /tmp otherwise.

       TS_SOCKET
              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's   not   specified,   it   will  be
              $TMPDIR/socket-ts.[uid].

              at system shutdown.


BUGS

       If you want to run complex commands, you may want to run  them  through
       sh  -c  'commands...'   Also, remember that stdin/stdout/stderr will be
       detached, so don't use your shell's redirection operators when you  put
       a job into background.

       If  an  internal  problem  is found in runtime, a file /tmp/ts.error is
       created, which you can submit to the developer in order to fix the bug.



SEE ALSO

       at(1)


AUTHOR

       Lluis Batlle i Rossell


NOTES

       This page describes ts as in version 0.4. Other versions my differ. The
       file TRICKS found in the distribution package can show  some  ideas  on
       special uses of ts.



Task Spooler 0.4                    2007-04                              TS(1)

Man(1) output converted with man2html