Displaying a list of scheduled jobs (at -l), Canceling a scheduled job (at -r) – HP NonStop G-Series User Manual

Page 144

Advertising
background image

lp outfile

<EOF>

127448228.a

Alternatively, you can submit multiple commands by entering the commands into a file and specifying
the filename on the at command. Use an editor, such as vi, to create the file with one command
on each line. For example, assume that filea contains the following:

c89 sfile.c -o bfile

bfile p1 p2 outfile

lp outfile

The following at command schedules these commands for execution at 10:00 a.m.:

$ at 1000 filea

127448231.a

The at command syntax allows you to specify the time and date of execution in a variety of ways.
The time parameter can be specified using the 24-hour clock or the 12-hour clock with an am or
pm

suffix. The optional date parameter can be specified as a day of the week or a month followed

by a day.

For example, the following command schedules the commands in filea for execution at 10:30
a.m. on Friday:

$ at 10:30 am Friday filea

The following command schedules the commands in filea for execution at 1400 hours (2:00
p.m.) on January 24:

$ at 1400 January 24 filea

The following command schedules the commands in filea for execution on March 4 at 12:00
p.m (using the date/time format MMddhhmm):

$ at 03041200 filea

If a command that you are scheduling for later execution produces screen output, consider
redirecting the output to a file, because you might not be logged on when the command is executed.
For example, the following at command schedules a ps command to run at 10:00 a.m. Output
from ps,normally sent to the screen, is redirected to fileb:

$ at 1000 ps > fileb

The following subsections describe two useful options for the at command. For a complete
description of at command syntax, see the at(1) reference pages either online or in the Open
System Services Shell and Utilities Reference Manual
.

Displaying a List of Scheduled Jobs (at -l)

You can display a list of scheduled jobs by entering the following at command:

$ at -l

The -l flag lists the job numbers assigned by at to all your currently scheduled jobs and the dates
and times those jobs are scheduled to run.

Canceling a Scheduled Job (at -r)

You can cancel a scheduled job by entering the following form of the at command:

at -r job-numbers

144 Managing Processes

Advertising
This manual is related to the following products: