aboutsummaryrefslogtreecommitdiffstats
path: root/doc/man/sat.1
blob: 93854b6b65d63c89e4d7e857fe29034b9e1d8656 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
.TH SAT 1 SAT
.SH NAME
sat \- Queue a job for later execution.
.SH SYNOPSIS
.B sat
.I TIME
.IR COMMAND ...
.SH DESCRIPTION
.BR sat (1)
is a simple implementation of
.BR at (1).
But is not compatible with
.BR at (1).
It is used to queue jobs to be executed later, outside
the current controlling terminal.
.PP
.BR sat (1)
shall launch
.BR satd (1),
unless it is already running, and queue a specified
.I COMMAND
to be executed at a selected
.IR TIME .
The job shall be executed with the same environment
variables and the same working directory (by
pathname) as
.BR sat (1)
had when the job was queued. However, if there is no
directory will the pathname matching the working
directory, when the job executes, the working directory
will be /, or whatever the working directory of
.BR satd (1)
(if
.BR satd (1)
is running in the foreground.)
.PP
The
.I TIME
argument must be specified in one of four formats:
.TP
.IB HH : MM
The job shall be executed the next time the clock is
.IR HH : MM :00.
.I HH
may by any positive value. The time is specified in UTC.
.TP
.IB HH : MM : SS
The job shall be executed the next time the clock is
.IR HH : MM : SS .
.I HH
and
.I SS
may by any positive values. The time is specified in UTC.
.TP
.I S
The job shall be executed the next time the POSIX time
clock shows
.IR S .
That is,
.I S
seconds passed Epoch (1970-01-01 00:00:00 UTC), ignoring
leap seconds (hence "the next time".)
.TP
.BI + S
The job shall be executed in
.I S
seconds.
.PP
Nanosecond resultion in
.I TIME
is supported.
.B Z
or
.B UTC
can be added at the end if
.IB HH : MM
or
.IB HH : MM : SS
is used. This suppresses a warning telling you that the
time was interpreted as UTC. It is not possible to select
any other timezone, not even the local timezone. If the
specified time is in the passed, but not more than 24
hours ago, 24 hours will be added to it, and a warning
is printed. This is so that you can use an external time
string parser without having to worry about its behaviour
too much.
.PP
If the
.BI + S
format is used,
.B sat
will use the
.B CLOCK_BOOTTIME
clock, for the other formats
.B CLOCK_REALTIME
is used. Note that this is
.B CLOCK_BOOTTIME
and
.BR CLOCK_REALTIME ,
not
.B CLOCK_BOOTTIME_ALARM
and
.BR CLOCK_REALTIME_ALARM .
If you want to the the latter clocks, you may want to
look in the direction of
.BR sleep-until (1).
.PP
The
.B sat
utilities can also print and edit the list of queued jobs.
.PP
If you are using
.BR autohaltd (8),
you should set up hooks for
.BR sat
that pauses
.BR autohaltd (8)
using
.B SIGSTOP
(and resume with
.BR SIGCONT )
when there are queued jobs. This would prevent
.BR autohaltd (8)
from shutting down the machine while there are queued jobs but
no logins.
.B sat
cannot stop
.BR autohaltd (8)
by adding login entries, because
.BR autohaltd (8)
will only recognise them if they are in fact true logins.
.SH OPTIONS
None.
.SH RATIONALE
.BR at (1)
is far too complex.
.PP
.B sat
does not do natural language time parsing, it is far too complex,
and locale dependent, for all programs to implement and should be
done in a separate program. Not even GNU
.BR date (1)
gets this right.
.B sat
does however do some trivial parsing.
.PP
.B sat
does not sanitise the environment. You have
.BR env (1)
for that. Relaying on
.B sat
to sanitise the environment appropriately could prove to be a
misfortune.
.PP
.B sat
does not do mailing because that is very restrictive, hooks are
used instead.
.PP
.B sat
does not do system load analysis, this should be done in a
separate program.
.PP
.B sat
only has one queue, queue can easily be emulated using dummy
commands, for example instead of \(aqmy command\(aq, you can
run \(aqsh -c ": QUEUE-a ; my command"\(aq.
.PP
.BR at (1)
should not be merged into
.BR cron (8).
.BR cron (8)
does recurring scheduled jobs,
.BR at (1)
does one-time unscheduled jobs.
.BR atq (1)
does not translate to
.BR cron (8).
.SH ENVIRONMENT
.TP
.B XDG_RUNTIME_DIR
This environment variable names the directory in which
interprocess communication related files are stored. If
unset or empty, /run is used.
.TP
.B SAT_HOOK_PATH
The pathname of the hook script to use. Does not have to
already exist. If not defined, $XDG_CONFIG_HOME/sat/hook
(if XDG_CONFIG_HOME is defined), $HOME/.config/sat/hook
(if HOME is defined), ~/.config/sat/hook (if the user has
a home and is not root), or /etc/sat/hook (otherwise) is
used.
.SH "FUTURE DIRECTIONS"
.B sat-atcompat
will be written to bring compatibility with old school
.BR at (1).
.SH NOTES
.BR nohup (1)
combined with
.BR sh (1)
and,
.BR sleep (1)
or
.BR sleep-until (1)
should be sufficient for most users.
.PP
.B sat
stores the job queue in a file. However, this file does not persist
between reboot.
.SH "SEE ALSO"
.BR at (1),
.BR cron (1),
.BR sleep-until (1),
.BR date (1),
.BR satq (1),
.BR satrm (1),
.BR satr (1),
.BR satd (1)
.SH AUTHORS
Principal author, Mattias Andrée.  See the COPYING file for the full
list of authors.
.SH LICENSE
MIT/Expat License.
.SH BUGS
Please report bugs to https://github.com/maandree/sat/issues or to
maandree@member.fsf.org