ts.1
author Lluís Batlle i Rossell <viric@viric.name>
Mon, 01 Apr 2024 11:06:42 +0200
changeset 379 1f8972dab2c1
parent 377 03029f8ceb3b
permissions -rw-r--r--
Added signature for changeset 13554e106f17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
309
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
     1
.\" Copyright LluĂ­s Batlle i Rossell
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     2
.\"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     3
.\" This file may be copied under the conditions described
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     4
.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     5
.\" that should have been distributed together with this file.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     6
.\" 
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     7
.\" Note: I took the gnu 'ls' man page as an example.
377
03029f8ceb3b Version 1.0.3
Lluís Batlle i Rossell <viric@viric.name>
parents: 372
diff changeset
     8
.TH TS 1 2020-12 "Task Spooler 1.0.3"
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
     9
.SH NAME
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    10
ts \- task spooler. A simple unix batch system
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    11
.SH SYNOPSIS
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    12
.BI "ts [" actions "] [" options "] [" command... ]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    13
.sp
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    14
Actions:
160
8b40ee19e765 Fixed small errors in the man/help.
viric@mandarina
parents: 159
diff changeset
    15
.BI "[\-KClhV]
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    16
.BI "[\-t ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    17
.BI "[\-c ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    18
.BI "[\-p ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    19
.BI "[\-o ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    20
.BI "[\-s ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    21
.BI "[\-r ["id ]]
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    22
.BI "[\-w ["id ]]
341
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
    23
.BI "[\-k ["id ]]
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    24
.BI "[\-u ["id ]]
159
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    25
.BI "[\-i ["id ]]
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    26
.BI "[\-U <"id - id >]
253
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
    27
.BI "[\-S ["num ]]
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    28
.sp
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    29
Options:
159
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    30
.BI "[\-nfgmd]"
160
8b40ee19e765 Fixed small errors in the man/help.
viric@mandarina
parents: 159
diff changeset
    31
.BI "[\-L <"label >]
266
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    32
.BI "[\-D <"id >]
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    33
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    34
.SH DESCRIPTION
89
94170d3b46d0 Fixed the manpage for TS_ONFINISH
viric@llimona
parents: 80
diff changeset
    35
.B ts
94170d3b46d0 Fixed the manpage for TS_ONFINISH
viric@llimona
parents: 80
diff changeset
    36
will run by default a per user unix task queue. The user can add commands to
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    37
the queue, watch that queue at any moment, and look at the task results
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    38
(actually, standard output and exit error).
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    39
.SH SIMPLE USE
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    40
Calling
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    41
.B ts
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    42
with a command will add that command to the queue, and calling it without
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    43
commands or parameters will show the task list.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    44
.SH COMMAND OPTIONS
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    45
When adding a job to ts, we can specify how it will be run and how will the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    46
results be collected:
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    47
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    48
.B "\-n"
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
    49
Do not store the standard output/error in a file at
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    50
.B $TMPDIR
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    51
- let it use the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    52
file descriptors decided by the calling process. If it is not used, the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    53
.B jobid
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    54
for the new task will be outputed to stdout.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    55
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    56
.B "\-g"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    57
Pass the output through gzip (only if
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    58
.B \-n
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    59
). Note that the output files will not
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    60
have a .gz extension.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    61
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    62
.B "\-f"
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
    63
Don not put the task into background. Wait the queue and the command run without
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    64
getting detached of the terminal. The exit code will be that of the command, and
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    65
if used together with \-n, no result will be stored in the queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    66
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    67
.B "\-m"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    68
Mail the results of the command (output and exit code) to
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    69
.B $TS_MAILTO
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    70
, or to the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    71
.B $USER
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    72
using
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    73
.B /usr/sbin/sendmail.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    74
Look at
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
    75
.B ENVIRONMENT.
159
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    76
.TP
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    77
.B "\-L <label>"
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    78
Add a label to the task, which will appear next to its command when listing
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    79
the queue. It makes more comfortable distinguishing similar commands with
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    80
different goals.
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    81
.TP
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    82
.B "\-d"
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    83
Run the command only if the command before finished well (errorlevel = 0). This new
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
    84
task enqueued depends on the result of the previous command. If the task is not run,
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
    85
it is considered as failed for further dependencies.
266
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    86
.TP
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    87
.B "\-D <id>"
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    88
Run the command only if the job of given id finished well (errorlevel = 0). This new
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    89
task enqueued depends on the result of the previous command. If the task is not run,
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    90
it is considered as failed for further dependencies.
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    91
If the server doesn't have the job id in its list, it will be considered
e35af91aa426 Fixing the help messages and man page for 0.6.3.
viric@mandarina
parents: 257
diff changeset
    92
as if the job failed.
299
73880166685f Making the manual page mention 0.7.0, and explain -B.
viric <viriketo@gmail.com>
parents: 283
diff changeset
    93
.TP
73880166685f Making the manual page mention 0.7.0, and explain -B.
viric <viriketo@gmail.com>
parents: 283
diff changeset
    94
.B "\-B"
73880166685f Making the manual page mention 0.7.0, and explain -B.
viric <viriketo@gmail.com>
parents: 283
diff changeset
    95
In the case the queue is full (due to \fBTS_MAXCONN\fR or system limits),
73880166685f Making the manual page mention 0.7.0, and explain -B.
viric <viriketo@gmail.com>
parents: 283
diff changeset
    96
by default ts will block the enqueuing command. Using \fB\-B\fR,
73880166685f Making the manual page mention 0.7.0, and explain -B.
viric <viriketo@gmail.com>
parents: 283
diff changeset
    97
if the queue is full it will exit returning the value 2 instead of blocking.
309
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
    98
.TP
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
    99
.B "\-E"
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
   100
Keep two different output files for the command stdout and stderr. stdout goes to
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
   101
the file announced by ts (look at \fB\-o\fR), and stderr goes to the stdout file
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
   102
with an additional ".e". For example, /tmp/ts-out.SKsDw8 and /tmp/ts-out.SKsDw8.e.
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
   103
Only the stdout file gets created with \fBmkstemp\fR, ensuring it does not overwrite
de0a7720dbc2 Updating the man page, for 0.7.2, describing the new option -E. (Reminded by Jan
viric <viriketo@gmail.com>
parents: 303
diff changeset
   104
any other; the ".e" will be overwritten if it existed.
320
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   105
.TP
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   106
.B "\-N <num>"
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   107
Run the command only if there are \fbnum\fB slots free in the queue. Without it,
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   108
the job will run if there is one slot free. For example, if you use the
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   109
queue to feed cpu cores, and you know that a job will take two cores, with \fB\-N\fB
549211f9affa Updating the manual to 0.7.3 (with -N).
viric <viriketo@gmail.com>
parents: 309
diff changeset
   110
you can let ts know that.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   111
.SH ACTIONS
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   112
Instead of giving a new command, we can use the parameters for other purposes:
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   113
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   114
.B "\-K"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   115
Kill the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   116
.B ts
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   117
server for the calling client. This will remove the unix socket and
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   118
all the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   119
.B ts
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   120
processes related to the queue. This will not kill the command being
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   121
run at that time.
96
d1bb8bfdebc3 Small addon for -K to the manual.
viric@llimona
parents: 93
diff changeset
   122
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   123
It is not reliable to think that
96
d1bb8bfdebc3 Small addon for -K to the manual.
viric@llimona
parents: 93
diff changeset
   124
.B ts -K
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   125
will finish when the server is really killed. By now it is a race condition.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   126
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   127
.B "\-C"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   128
Clear the results of finished jobs from the queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   129
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   130
.B "\-l"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   131
Show the list of jobs - to be run, running and finished - for the current queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   132
This is the default behaviour if
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   133
.B ts
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   134
is called without options.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   135
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   136
.B "\-t [id]"
184
a081c209c21b Updating the makedeb code, and the manpage, according to 0.5
viric@llimona
parents: 164
diff changeset
   137
Show the last ten lines of the output file of the named job, or the last
a081c209c21b Updating the makedeb code, and the manpage, according to 0.5
viric@llimona
parents: 164
diff changeset
   138
running/run if not specified. If the job is still running, it will keep on
a081c209c21b Updating the makedeb code, and the manpage, according to 0.5
viric@llimona
parents: 164
diff changeset
   139
showing the additional output until the job finishes. On exit, it returns the
a081c209c21b Updating the makedeb code, and the manpage, according to 0.5
viric@llimona
parents: 164
diff changeset
   140
errorlevel of the job, as in \fB\-c\fR.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   141
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   142
.B "\-c [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   143
Run the system's cat to the output file of the named job, or the last
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   144
running/run if not specified. It will block until all the output can be
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   145
sent to standard output, and will exit with the job errorlevel as in
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   146
\fB\-c\fR.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   147
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   148
.B "\-p [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   149
Show the pid of the named job, or the last running/run if not specified.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   150
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   151
.B "\-o [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   152
Show the output file name of the named job, or the last running/run 
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   153
if not specified.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   154
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   155
.B "\-s [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   156
Show the job state of the named job, or the last in the queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   157
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   158
.B "\-r [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   159
Remove the named job, or the last in the queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   160
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   161
.B "\-w [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   162
Wait for the named job, or for the last in the queue.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   163
.TP
341
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   164
.B "\-k [id]"
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   165
Kill the process group of the named job (SIGTERM),
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   166
or the last running/run job if not specified.
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   167
Equivalent to
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   168
.B kill -- -`ts -p`
1169cb2d5557 Increasing version to 0.7.6, and update manuals.
viric <viriketo@gmail.com>
parents: 337
diff changeset
   169
.TP
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   170
.B "\-u [id]"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   171
Make the named job (or the last in the queue) urgent - this means that it goes
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   172
forward in the queue so it can run as soon as possible.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   173
.TP
159
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   174
.B "\-i [id]"
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   175
Show information about the named job (or the last run). It will show the command line,
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   176
some times related to the task, and also any information resulting from
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   177
\fBTS_ENV\fR (Look at \fBENVIRONMENT\fR).
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   178
.TP
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   179
.B "\-U <id-id>"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   180
Interchange the queue positions of the named jobs (separated by a hyphen and no
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   181
spaces).
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   182
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   183
.B "\-h"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   184
Show help on standard output.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   185
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   186
.B "\-V"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   187
Show the program version.
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   188
.SH MULTI-SLOT
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   189
.B ts
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   190
by default offers a queue where each job runs only after the previous finished.
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   191
Nevertheless, you can change the maximum number of jobs running at once with
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   192
the
253
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
   193
.B "\-S [num]"
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   194
parameter. We call that number the
243
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   195
\fIamount of slots\fR. You can also set the initial number of jobs with
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   196
the environment variable
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   197
.B "TS_SLOTS".
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   198
When increasing this setting, queued waiting jobs will be run
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   199
at once until reaching the maximum set. When decreasing this setting, no other
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   200
job will be run until it can meet the amount of running jobs set.
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   201
.BR
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   202
When using an amount of slots greater than 1, the action of some commands
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   203
may change a bit. For example, \fB\-t\fR without \fIjobid\fR will tail the first
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   204
job running, and \fB\-d\fR will try to set the dependency with the last job added.
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   205
.TP
253
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
   206
.B "\-S [num]"
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
   207
Set the maximum amount of running jobs at once. If you don't specify
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
   208
.B num
e9b153f4ae40 Making "-S" to return the number of slots set, if without additional argument.
viric@mandarina
parents: 243
diff changeset
   209
it will return the maximum amount of running jobs set.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   210
.SH ENVIRONMENT
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   211
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   212
.B "TS_MAXFINISHED"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   213
Limit the number of job results (finished tasks) you want in the queue. Use this
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   214
option if you are tired of
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   215
.B \-C.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   216
.TP
280
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   217
.B "TS_MAXCONN"
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   218
The maximum number of ts server connections to clients. This will make the ts clients
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   219
block until connections are freed. This helps, for example, on systems with a limited
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   220
number of processes, because each job waiting in the queue remains as a process. This
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   221
variable has to be set at server start, and cannot be modified later.
d207fb747144 Updating the manual for TS_MAXCONN
viric@mandarina
parents: 266
diff changeset
   222
.TP
89
94170d3b46d0 Fixed the manpage for TS_ONFINISH
viric@llimona
parents: 80
diff changeset
   223
.B "TS_ONFINISH"
142
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   224
If the variable exists pointing to an executable, it will be run by the client
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   225
after the queued job. It uses execlp, so
89
94170d3b46d0 Fixed the manpage for TS_ONFINISH
viric@llimona
parents: 80
diff changeset
   226
.B PATH
93
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   227
is used if there are no slashes in the variable content. The executable is run
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   228
with four parameters:
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   229
.B jobid
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   230
.B errorlevel
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   231
.B output_filename
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   232
and
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   233
.B command.
89
94170d3b46d0 Fixed the manpage for TS_ONFINISH
viric@llimona
parents: 80
diff changeset
   234
.TP
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   235
.B "TMPDIR"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   236
As the program output and the unix socket are thought to be stored in a
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   237
temporary directory, 
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   238
.B TMPDIR
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   239
will be used if defined, or
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   240
.B /tmp
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   241
otherwise.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   242
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   243
.B "TS_SOCKET"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   244
Each queue has a related unix socket. You can specify the socket path with this
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   245
environment variable. This way, you can have a queue for your heavy disk
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   246
operations, another for heavy use of ram., and have a simple script/alias
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   247
wrapper over ts for those special queues. If it is not specified, it will be
119
361b08d33762 $USER is no more used for crating the socket path. Now the UID is used.
viric@llimona
parents: 100
diff changeset
   248
.B $TMPDIR/socket-ts.[uid].
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   249
.TP
243
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   250
.B "TS_SLOTS"
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   251
Set the number of slots at the start of the server, similar to
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   252
.B \-S,
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   253
but the contents of the variable are read only when running
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   254
the first instance of
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   255
.B ts.
1c03322a3b66 Updating the manpage for 0.6.1
viric@mandarina
parents: 232
diff changeset
   256
.TP
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   257
.B "TS_MAILTO"
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   258
Send the letters with job results to the address specified in this variable.
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   259
Otherwise, they are sent to
119
361b08d33762 $USER is no more used for crating the socket path. Now the UID is used.
viric@llimona
parents: 100
diff changeset
   260
.B $USER
361b08d33762 $USER is no more used for crating the socket path. Now the UID is used.
viric@llimona
parents: 100
diff changeset
   261
or if not defined,
361b08d33762 $USER is no more used for crating the socket path. Now the UID is used.
viric@llimona
parents: 100
diff changeset
   262
.B nobody.
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   263
The system
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   264
.B /usr/sbin/sendmail
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   265
is used. The
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   266
job outputs are not sent as an attachment, so understand the consequences if you
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   267
use the
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   268
.B \-gm
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   269
flags together.
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   270
.TP
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   271
.B "USER"
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   272
As seen above, it is used for the mail destination if
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   273
.B TS_MAILTO
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   274
is not specified.
120
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 119
diff changeset
   275
.TP
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 119
diff changeset
   276
.B "TS_SAVELIST"
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   277
If it is defined when starting the queue server (probably the first
120
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 119
diff changeset
   278
.B ts
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 119
diff changeset
   279
command run), on SIGTERM the queue status will be saved to the file pointed
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 119
diff changeset
   280
by this environment variable - for example, at system shutdown.
159
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   281
.TP
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   282
.B "TS_ENV"
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   283
This has a command to be run at enqueue time through
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   284
\fB/bin/sh\fR. The output of the command will be readable through the option
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   285
\fB\-i\fR. You can use a command which shows relevant environment for the command run.
76293ced27b5 Updated manpage and help.
viric@mandarina
parents: 145
diff changeset
   286
For example, you may use \fBTS_ENV='pwd;set;mount'\fR.
142
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   287
.SH FILES
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   288
.TP
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   289
.B /tmp/ts.error
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   290
if
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   291
.B ts
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   292
finds any internal problem, you should find an error report there.
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   293
Please send this to the author as part of the bug report.
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   294
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   295
.SH BUGS
142
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   296
.B ts
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   297
expects a simple command line. It does not start a shell parser.
142
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   298
If you want to run complex shell commands, you may want to run them through
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   299
.B sh -c 'commands...'
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   300
Also, remember that stdin/stdout/stderr will be detached, so
232
7201bb3ee30d Updating the man page for 0.6 (also removed some verbal short forms)
llbatlle@taga
parents: 184
diff changeset
   301
do not use your shell's redirection operators when you put a job into background.
142
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   302
You can use them inside the
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   303
.B sh -c
f78c77997a5e Improved manpage, more info on ts.error.
viric@llimona
parents: 127
diff changeset
   304
in order to set redirections to the command run.
80
be0fb7e56061 New Changelog, updated README, and the manpage.
viric@llimona
parents: 78
diff changeset
   305
93
332574eacf8a Better manpage on TS_ONFINISH.
viric@llimona
parents: 92
diff changeset
   306
If an internal problem is found in runtime, a file
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 89
diff changeset
   307
.B /tmp/ts.error
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 89
diff changeset
   308
is created, which you can submit to the developer in order to fix the bug.
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 89
diff changeset
   309
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   310
.SH SEE ALSO
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   311
.BR at (1)
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   312
.SH AUTHOR
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   313
Lluis Batlle i Rossell
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   314
.SH NOTES
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   315
This page describes
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents:
diff changeset
   316
.B ts
354
d8042e4ba43d Changing version from 1.0.0 to 1.0
viric <viriketo@gmail.com>
parents: 349
diff changeset
   317
as in version 1.0. Other versions may differ. The file
80
be0fb7e56061 New Changelog, updated README, and the manpage.
viric@llimona
parents: 78
diff changeset
   318
.B TRICKS
be0fb7e56061 New Changelog, updated README, and the manpage.
viric@llimona
parents: 78
diff changeset
   319
found in the distribution package can show some ideas on special uses of
be0fb7e56061 New Changelog, updated README, and the manpage.
viric@llimona
parents: 78
diff changeset
   320
.B ts.