Up: interfaces [Contents][Index]
This section documents the interface to the atd
daemon; we may want to read the
at
(1) manual page. The at
service allows a user to schedule commands to be
executed at a later time.
This interface is suitable for scripts that define a unique simple policy to schedule commands; example: at each run they schedule a command in a fixed queue, to be executed at a fixed time in the future.
This is good to implement the logic: if a condition does not happen before time T
, then
execute command C
.
Declare the intention to use the at
interface. Declaring the
intention to use a program.
The declared programs are: at
, atq
, atrm
.
Return true if letter is a valid queue identifier, else return false.
Return true if the currently selected queue identifier is valid, else print an error message and return false. A false return code means that an internal error has corrupted the module’s state.
Select and register in an internal state a queue identifier; invoke
mbfl_at_validate_queue_letter()
to validate the selection.
Schedule command in the currently selected queue; the script will be executed at time.
If no error occurs: print to stdout the identifier of the scheduled job; the identifier can be used
as argument to mbfl_at_drop()
.
The
at
command outputs some text (in which the job is embedded) on itsstderr
channel, so this function redirectsstderr
tostdout
to return the value; this operation conflicts with the use of the “show program” feature ofmbfl_program_exec()
.
command must be a string representing the invocation of an external executable program: it is
sent unchanged to the at
command. time is the argument to the at
command,
see the manual page for its description.
Remove a job; the identifier of a job is unique in all the queues, so this function is not affected by the currently selected queue.
Remove all the jobs from the currently selected queue.
Print all the job identifiers in the currently selected queue.
Print all the job descriptions in the currently selected queue.
Print the letters identifying queues with pending jobs.
Print the currently selected queue letter.
Up: interfaces [Contents][Index]