Go to main content

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

Exit Print View

Updated: August 2021

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 at which to execute your job.
    $ at [-m] time [date] 

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


    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.


    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 jdoe 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/jdoe/*.backup
at> Press Control-D
job 897355800.a at Sun  Sep 8 19:30:00 2019

The following email message confirmed the execution of her at job.

Your "at" job rm /home/jdoe/*.backup" completed.

The following example shows how jdoe 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/jdoe/big.file