|
|
You can run commands at an arbitrary time in the future[1] by using the at(C) and batch(C) commands. at allows you to specify a time when the command should be executed, and batch executes the command when the system load level permits. The at command uses the format at sometime command where sometime is a time and date in the future when command will be executed. at is useful for sending yourself reminders, for example:
$ at 1:00pm Jan 24
mail -s "Technical Publications meeting at 1:15" jdixon
<Ctrl>D
job 782560800.a at Mon Jan 24 13:00:00 BST 1994
$
This command sends a blank mail message entitled Technical Publications
meeting at 1:15
to jdixon at 1:00P.M. on
January 24.
at allows times and dates to be specified in a wide variety of ways. See at(C) for details.
To display a list of current at jobs, type at -l. To remove at jobs and their identification numbers, type at -r job_id; to delete the at job queued in the last example, enter the following:
$ at -r 782560800.aNote that the trailing ``.a'' must be specified. This distinguishes at jobs from batch jobs, which have a trailing ``.b''.
batch takes no arguments and submits a command for immediate execution at lower priority than an ordinary at command. For example:
$ batch
compress *.txt
<Ctrl>D
$
This command compresses all the files ending in .txt in
the current directory. The job will be executed when the load on the
system permits.
The at and batch commands are available only to users whose user names appear in the /usr/lib/cron/at.allow file: users who are specifically barred from using these facilities appear in /usr/lib/cron/at.deny. These files are editable only by the root user.