blob: fe6e753cf806a5558cdd70cb2ef63285e14915aa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
@node Hooks
@chapter Hooks
@command{satd} runs a hook script, if available, whenever
something important happens. The pathname of the hook
script is determined by the environment variable
@env{SAT_HOOK_PATH}, see @ref{Invoking} for its fallbacks.
The script is run when a job as run and removed. The script
will run with an environment identical to the job, which is
idential to the environment @command{sat} had when the job
was queued. The first argument, excluding the zeroth argument
(the pathname of the script) in the hook script's command
line will be the action that is performed, the following
arguments are job's command line arguments including the
zeroth argument (the name of the command). Possible actions
are:
@table @code
@item queued
The job with queued using @command{sat}.
@item expired
The job will run momentarily as scheduled.
@item forced
The job will run momentarily due to use of @command{satr}.
@item failure
The job could not be executed or failed.
@item success
The job ran successfully.
@item removed
The job with removed using @command{satrm}.
@end table
@noindent
@command{satd} ensure that the script is not run between
@code{expired} and @code{forced} and corresponding
@code{failure} or @code{success}.
A very simple way to inform when these actions take place
is to use the script
@example
#!/bin/sh
action="$1"
shift 1
exec wall "sat: $action: $JOBNAME ($*)"
@end example
@noindent
and always set the environment variable @env{JOBNAME}
to a string that identifies the job when queuing it
using @command{sat}.
|