Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: August 2018
 
 

Creating an at Job

The following task describes how to create and at job.

How to Create an at Job

  1. Start the at utility, specifying the time you want your job executed.
    $ at [-m] time [date] 
    -m

    Specifies to send you an email after the job is completed.

    time

    Specifies the hour that you want to schedule the job. Add am or pm if you do not specify the hours according to the 24-hour clock. Acceptable keywords are midnight, noon, and now. Minutes are optional.

    date

    Specifies the first three or more letters of a month, a day of the week, or the keywords today or tomorrow.

  2. At the at prompt, type the commands or scripts that you want to execute, one per line.

    You may type more than one command by pressing Return at the end of each line.

  3. Press Control-D to exit the at utility and save the at job.

    Your at job is assigned a queue number, which is also the job's file name. This number is displayed when you exit the at utility.

Example 39  Creating an at Job

The following example shows the at job that user jones created to remove her backup files at 7:30 p.m. She used the –m option so that she would receive an email message after her job completed.

$ at -m 1930
at> rm /home/jones/*.backup
at> Press Control-D
job 897355800.a at Thu Jul  12 19:30:00 2004

She received a email message which confirmed the execution of her at job.

Your “at” job “rm /home/jones/*.backup”
completed.

The following example shows how jones scheduled a large at job for 4:00 a.m. Saturday morning. The job output was directed to a file named big.file.

$ at 4 am Saturday
at> sort -r /usr/dict/words > /export/home/jones/big.file