| 1 | AT(1) UNIX Reference Manual AT(1) |
| 2 | |
| 3 | N\bNA\bAM\bME\bE |
| 4 | a\bat\bt - schedule execution of commands `at' a given time |
| 5 | |
| 6 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS |
| 7 | a\bat\bt [-\b-c\bc] [-\b-s\bs] [-\b-m\bm] _\bt_\bi_\bm_\be [_\bd_\ba_\by] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be] |
| 8 | |
| 9 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN |
| 10 | A\bAt\bt schedules execution of commands at the specified _\bt_\bi_\bm_\be. The commands |
| 11 | may be given to a\bat\bt via the _\bc_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be or accepted from the standard in- |
| 12 | put. A\bAt\bt will pass these commands to the appropriate shell at the re- |
| 13 | quested time. While awaiting execution, the jobs reside in a spool direc- |
| 14 | tory and may be examined by the atq(1) program. |
| 15 | |
| 16 | Options available: |
| 17 | |
| 18 | -\b-c\bc _\bC_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be contains csh(1) commands. |
| 19 | |
| 20 | -\b-s\bs _\bC_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be contains sh(1) commands. |
| 21 | |
| 22 | -\b-m\bm Mail will be sent to the user after the job has been run. If |
| 23 | errors occur during execution of the job, then a copy of the |
| 24 | error diagnostics will be sent to the user. If no errors occur, |
| 25 | then a short message is sent informing the user that no errors |
| 26 | occurred. |
| 27 | |
| 28 | If a _\bc_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be is not specified, a\bat\bt prompts for commands from standard |
| 29 | input until a `^D' is typed. |
| 30 | |
| 31 | The format of the spool file is as follows: A four line header that |
| 32 | includes the owner of the job, the name of the job, the shell used to run |
| 33 | the job, and whether mail will be sent after the job is executed. The |
| 34 | header is followed by a c\bcd\bd command to the current directory and a u\bum\bma\bas\bsk\bk |
| 35 | command to set the modes on any files created by the job. Then a\bat\bt copies |
| 36 | all relevant environment variables to the spool file. When the script is |
| 37 | run, it uses the user and group ID of the creator of the spool file. |
| 38 | |
| 39 | The _\bt_\bi_\bm_\be is either a 24 hour military time _\bh_\bh_\bm_\bm, where _\bh_\bh is hour and _\bm_\bm |
| 40 | is minutes, or the traditional 12 hour time with qualifying options: |
| 41 | |
| 42 | am, a am |
| 43 | pm, p pm |
| 44 | n noon |
| 45 | m midnight |
| 46 | |
| 47 | The time can be abbreviated as shown below in EXAMPLES. |
| 48 | |
| 49 | A _\bd_\ba_\by of the week may be specified by the first two letters of its name. |
| 50 | A week (7 days) may be specified by the argument _\bw_\be_\be_\bk. If a month name |
| 51 | is given, the following argument is expected to be the day (numeric). |
| 52 | |
| 53 | E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT |
| 54 | If a shell is not specified, the current environment variable SHELL is |
| 55 | used. |
| 56 | |
| 57 | E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS |
| 58 | at 10p Execute at 10pm today, or tomorrow if 10pm has past. Use the |
| 59 | shell found in the environment variable SHELL. |
| 60 | |
| 61 | at -c -m 1705 mo |
| 62 | Execute at 5:05pm on Monday using csh(1) and send mail upon |
| 63 | completion or termination of the job. |
| 64 | |
| 65 | at -s -m 1200n week |
| 66 | Use sh(1), send mail upon completetion, start at noon |
| 67 | o'clock, one week from today. |
| 68 | at -s 8a apr 1 |
| 69 | Ideally this would be given late in March. The commands |
| 70 | would be run at 8 am on April first, using the sh(1). |
| 71 | |
| 72 | E\bER\bRR\bRO\bOR\bRS\bS |
| 73 | Errors must be collected via the -\b-m\bm option or by redirecting the standard |
| 74 | output from inside the _\bc_\bo_\bm_\bm_\ba_\bn_\bd__\bf_\bi_\bl_\be. |
| 75 | |
| 76 | F\bFI\bIL\bLE\bES\bS |
| 77 | /_\bv_\ba_\br/_\bs_\bp_\bo_\bo_\bl/_\ba_\bt spooling area |
| 78 | /_\bv_\ba_\br/_\bs_\bp_\bo_\bo_\bl/_\ba_\bt/_\by_\by._\bd_\bd_\bd._\bh_\bh_\bh_\bh.* job file |
| 79 | /_\bv_\ba_\br/_\bs_\bp_\bo_\bo_\bl/_\ba_\bt/_\bp_\ba_\bs_\bt directory where jobs are executed from |
| 80 | /_\bv_\ba_\br/_\bs_\bp_\bo_\bo_\bl/_\ba_\bt/_\bl_\ba_\bs_\bt_\bt_\bi_\bm_\be_\bd_\bo_\bn_\be last time atrun was run |
| 81 | /_\bv_\ba_\br/_\bl_\bi_\bb_\be_\bx_\be_\bc/_\ba_\bt_\br_\bu_\bn executor (run by cron(8)) |
| 82 | |
| 83 | |
| 84 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO |
| 85 | atq(1), atrm(1), calendar(1), cron(8) sleep(1), |
| 86 | |
| 87 | D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS |
| 88 | Complains about various syntax errors and times out of range. |
| 89 | |
| 90 | H\bHI\bIS\bST\bTO\bOR\bRY\bY |
| 91 | A\bAt\bt appeared in Version 7 AT&T UNIX. |
| 92 | |
| 93 | B\bBU\bUG\bGS\bS |
| 94 | The queueing mechanism /_\bu_\bs_\br/_\bl_\bi_\bb_\be_\bx_\be_\bc/_\ba_\bt_\br_\bu_\bn, is scheduled by cron(8). Fre- |
| 95 | quency with which cron(8) runs /_\bu_\bs_\br/_\bl_\bi_\bb_\be_\bx_\be_\bc/_\ba_\bt_\br_\bu_\bn is site dependent. If |
| 96 | it is run infrequently, a job may fall thru the cracks. |
| 97 | |
| 98 | There are known problems attempting to specify a time of 2400 hours to |
| 99 | a\bat\bt. |
| 100 | |
| 101 | If the system crashes, mail is not sent to the user informing them that |
| 102 | the job was not completed. |
| 103 | |
| 104 | Sometimes old spool files are not removed from the directory |
| 105 | /_\bv_\ba_\br/_\bs_\bp_\bo_\bo_\bl/_\ba_\bt/_\bp_\ba_\bs_\bt. This is usually due to a system crash, and requires |
| 106 | that they be removed by hand. |