사용 버전 : Linux 우분투(레드햇 계열) 24.04.01 LTS 버전
사용한 시스템 지역/언어 : 대한민국/한글
해당 명령은 초기에 포함되지 않은 명령으로 다음 명령으로 설치할 수 있다.
sudo apt install at
man at 원문
AT(1) General Commands Manual AT(1)
NAME
at, batch, atq, atrm - queue, examine, or delete jobs for later execu‐
tion
SYNOPSIS
at [-V] [-q queue] [-f file] [-u username] [-mMlv] timespec ...
at [-V] [-q queue] [-f file] [-u username] [-mMkv] [-t time]
at -c job [...]
at [-V] -l [-o timeformat] [job ...]
atq [-V] [-q queue] [-o timeformat] [job ...]
at [-rd] job [...]
atrm [-V] job [...]
batch
at -b
DESCRIPTION
at and batch read commands from standard input or a specified file
which are to be executed at a later time, using /bin/sh.
at executes commands at a specified time.
atq lists the user's pending jobs, unless the user is the supe‐
ruser; in that case, everybody's jobs are listed. The format
of the output lines (one for each job) is: Job number, date,
hour, queue, and username.
atrm deletes jobs, identified by their job number.
batch executes commands when system load levels permit; in other
words, when the load average drops below 1.5, or the value
specified in the invocation of atd.
At allows fairly complex time specifications, extending the POSIX.2
standard. It accepts times of the form HH:MM to run a job at a spe‐
cific time of day. (If that time is already past, the next day is as‐
sumed.) You may also specify midnight, noon, or teatime (4pm) and you
can have a time-of-day suffixed with AM or PM for running in the morn‐
ing or the evening. You can also say what day the job will be run, by
giving a date in the form month-name day with an optional year, or giv‐
ing a date of the form MMDD[CC]YY, MM/DD/[CC]YY, DD.MM.[CC]YY or
[CC]YY-MM-DD. The specification of a date must follow the specifica‐
tion of the time of day. You can also give times like now + count
time-units, where the time-units can be minutes, hours, days, or weeks
and you can tell at to run the job today by suffixing the time with to‐
day and to run the job tomorrow by suffixing the time with tomorrow.
For example, to run a job at 4pm three days from now, you would do at
4pm + 3 days, to run a job at 10:00am on July 31, you would do at 10am
Jul 31 and to run a job at 1am tomorrow, you would do at 1am tomorrow.
If you specify a job to absolutely run at a specific time and date in
the past, the job will run as soon as possible. For example, if it is
8pm and you do a at 6pm today, it will run more likely at 8:05pm.
The definition of the time specification can be found in
/usr/share/doc/at/timespec.
For both at and batch, commands are read from standard input or the
file specified with the -f option and executed. The working directory,
the environment (except for the variables BASH_VERSINFO, DISPLAY, EUID,
GROUPS, SHELLOPTS, TERM, UID, and _) and the umask are retained from
the time of invocation.
As at is currently implemented as a setuid program, other environment
variables (e.g., LD_LIBRARY_PATH or LD_PRELOAD) are also not exported.
This may change in the future. As a workaround, set these variables
explicitly in your job.
An at - or batch - command invoked from a su(1) shell will retain the
current userid. The user will be mailed standard error and standard
output from his commands, if any. Mail will be sent using the command
/usr/sbin/sendmail. If at is executed from a su(1) shell, the owner of
the login shell will receive the mail.
The superuser may use these commands in any case. For other users,
permission to use at is determined by the files /etc/at.allow and
/etc/at.deny. See at.allow(5) for details.
OPTIONS
-V prints the version number to standard error and exit success‐
fully.
-q queue
uses the specified queue. A queue designation consists of a
single letter; valid queue designations range from a to z and A
to Z. The a queue is the default for at and the b queue for
batch. Queues with higher letters run with increased niceness.
The special queue "=" is reserved for jobs which are currently
running.
If a job is submitted to a queue designated with an uppercase letter,
the job is treated as if it were submitted to batch at the time of the
job. Once the time is reached, the batch processing rules with respect
to load average apply. If atq is given a specific queue, it will only
show jobs pending in that queue.
-m Send mail to the user when the job has completed even if there
was no output.
-M Never send mail to the user.
-u username
Sends mail to username rather than the current user.
-f file Reads the job from file rather than standard input.
-t time run the job at time, given in the format [[CC]YY]MMDDhhmm[.ss]
-l Is an alias for atq.
-r Is an alias for atrm.
-d Is an alias for atrm.
-b is an alias for batch.
-v Shows the time the job will be executed before reading the job.
Times displayed will be in the format "Thu Feb 20 14:50:00 1997".
-c cats the jobs listed on the command line to standard output.
-o fmt strftime-like time format used for the job list
FILES
/var/spool/cron/atjobs
/var/spool/cron/atspool
/proc/loadavg
/var/run/utmp
/etc/at.allow
/etc/at.deny
SEE ALSO
at.allow(5), at.deny(5), atd(8), cron(1), nice(1), sh(1), umask(2).
BUGS
The correct operation of batch for Linux depends on the presence of a
proc- type directory mounted on /proc.
If the file /var/run/utmp is not available or corrupted, or if the user
is not logged on at the time at is invoked, the mail is sent to the
userid found in the environment variable LOGNAME. If that is undefined
or empty, the current userid is assumed.
At and batch as presently implemented are not suitable when users are
competing for resources. If this is the case for your site, you might
want to consider another batch system, such as nqs.
AUTHOR
At was mostly written by Thomas Koenig.
2009-11-14 AT(1)
man at 번역기 번역본
at (1) 일반 명령 매뉴얼 at(1)
이름
AT, Batch, ATQ, ATRM- 대기열, 나중에 execu-를 위해 작업을 검사하거나 삭제하십시오.
tion
개요
[-v] [-q queue] [-f file] [-u username] [-mmlv] timespec ...
[-v] [-q queue] [-f file] [-u username] [-mkv] [-t time]
-C job에서 [...]
[-v] -l [-o timeformat] [job ...]
atq [-v] [-q queue] [-o timeformat] [job ...]
[-rd] 직업 [...]
Atrm [-v] 작업 [...]
일괄
-B
설명
표준 입력 또는 지정된 파일의 AT 및 배치 읽기 명령
/bin /sh를 사용하여 나중에 실행됩니다.
지정된 시간에 명령을 실행합니다.
ATQ는 사용자가 SUPE가 아닌 한 사용자의 보류중인 작업을 나열합니다.
Ruser; 이 경우 모든 사람의 직업이 나열됩니다. 형식
출력 라인 (각 작업마다 1 개) 중 하나는 작업 번호, 날짜,
시간, 큐 및 사용자 이름.
ATRM은 작업 번호로 식별 된 작업을 삭제합니다.
배치는 시스템로드 레벨이 허용 될 때 명령을 실행합니다. 다른
단어, 부하 평균이 1.5 미만 또는 값이 떨어질 때
ATD 호출에 지정됩니다.
At은 POSIX.2 표준을 확장하여 상당히 복잡한 시간 지정을 허용합니다. HH:MM 형식의 시간을 허용하여 특정 시간에 작업을 실행합니다. (해당 시간이 이미 지난 경우 다음 날로 가정합니다.) 자정, 정오 또는 오후 4시를 지정할 수도 있으며 오전 또는 저녁에 실행하기 위해 AM 또는 PM 접미사를 붙일 수 있습니다. 또한 작업을 실행할 요일을 지정할 수 있으며, 월 이름 일 형식으로 날짜를 지정하고 선택적으로 년도를 지정하거나 MMDD[CC]YY, MM/DD/[CC]YY, DD.MM.[CC]YY 또는
[CC]YY-MM-DD 형식으로 날짜를 지정합니다. 날짜 지정은 시간 지정을 따라야 합니다. 또한 '지금 + 시간 단위' 형식으로 시간을 지정할 수 있습니다. 여기서 시간 단위는 분, 시간, 일 또는 주가 될 수 있으며, '오늘'이라는 접미사를 시간 뒤에 붙여서 오늘 작업을 실행하도록 할 수 있고, '내일'이라는 접미사를 시간 뒤에 붙여서 내일 작업을 실행하도록 할 수 있습니다.
예를 들어, 지금부터 3 일 오후 4시에 일자리를 실행하려면
오후 4시 + 3 일, 7 월 31 일 오전 10시에 일자리를 얻으려면 오전 10시에 할 것입니다.
7 월 31 일, 내일 오전 1시에 일자리를 얻으려면 내일 오전 1시에 할 것입니다.
특정 시간과 날짜에 절대적으로 실행할 작업을 지정하는 경우
과거, 직업은 가능한 한 빨리 진행될 것입니다. 예를 들어, 그렇다면
오후 8시와 오늘 오후 6시에 오후 8시 5 분에 더 많이 달릴 것입니다.
시간 사양의 정의는
/usr/share/doc/at/timespec.
AT 및 배치 모두에 대해 명령은 표준 입력 또는
-f 옵션으로 지정되고 실행 된 파일. 작업 디렉토리,
환경 (변수 bash_versinfo, display, euid,
그룹, Shellopts, Term, Uid 및 _) 및 Umask는
호출 시간.
AT와 마찬가지로 현재 세상 프로그램, 기타 환경으로 구현되었습니다.
변수 (예 : LD_LIBRARY_PATH 또는 LD_PRELOAD)도 내보내지 않습니다.
이것은 미래에 변할 수 있습니다. 해결 방법 으로이 변수를 설정하십시오
당신의 직업에서 명시 적으로.
SU (1) 쉘에서 호출 된 AT- 또는 배치 - 명령은 다음을 유지합니다.
현재 userID. 사용자는 표준 오류 및 표준이 우송됩니다
그의 명령에서 출력. 메일은 명령을 사용하여 전송됩니다
/usr/sbin/sendmail. AT가 SU (1) 쉘에서 실행되는 경우
로그인 쉘은 메일을받습니다.
슈퍼업자는 어쨌든 이러한 명령을 사용할 수 있습니다. 다른 사용자의 경우
사용 권한은 /etc/at.allow 파일에 의해 결정됩니다.
/etc/at.deny. 자세한 내용은 at.allow (5)를 참조하십시오.
옵션
-V 버전 번호를 표준 오류로 인쇄하고 성공을 종료합니다.
충분히.
-Q 큐
지정된 큐를 사용합니다. 대기열 명칭은 a로 구성됩니다
단일 편지; 유효한 대기열 지정은 a에서 z까지입니다.
Z. A 큐는 AT의 기본값과 B 큐입니다.
일괄. 더 높은 문자가있는 대기열은 좋은 점이 증가합니다.
특별 대기열 "="는 현재 일자리를 위해 예약되어 있습니다.
달리기.
작업이 대문자로 지정된 대기열에 제출 된 경우
작업은 마치시기에 배치에 제출 된 것처럼 취급됩니다.
직업. 시간에 도달하면 배치 처리 규칙은
평균을로드하려면 적용됩니다. ATQ가 특정 대기열이 주어지면
그 줄에 보류중인 일자리를 보여주십시오.
-M 작업이 완료된 경우 사용자에게 메일을 보내십시오.
출력이 없었습니다.
-음은 사용자에게 메일을 보내지 않습니다.
-U 사용자 이름
현재 사용자가 아닌 사용자 이름으로 메일을 보냅니다.
-f 파일은 표준 입력 대신 파일에서 작업을 읽습니다.
-t 시간은 [[cc] yy] mmddhhmm [.SS] 형식으로 주어진 시간에 작업을 실행합니다.
-L은 ATQ의 별칭입니다.
-R은 ATRM의 별칭입니다.
-D는 ATRM의 별칭입니다.
-B는 배치의 별칭입니다.
-V는 작업을 읽기 전에 작업이 실행되는 시간을 보여줍니다.
표시되는 시간은 "2 월 20 일 14:50:00 1997"형식으로 표시됩니다.
-C 고양이는 명령 줄에 표준 출력으로 나열된 작업을 고양이입니다.
-O FMT Strftime과 같은 시간 형식 작업 목록에 사용됩니다.
파일
/spool/cron/atjobs
/spool/cron/atspool
/Proc/Load Naval
/run/utmp
/etc/at.allow
/etc/at.eny
참조하십시오
at.allow (5), at.deny (5), atd (8), cron (1), 니스 (1), sh (1), umask (2).
버그
Linux에 대한 배치의 올바른 작동은
Proc-Type 디렉토리 장착 /Proc.
파일/var/run/utmp를 사용할 수 없거나 손상된 경우 또는 사용자가
당시에 로그온하지 않아서 호출되고 메일이 전송됩니다.
환경 변수 로그 이름에서 찾은 userId. 그것이 정의되지 않은 경우
또는 비어 있으면 현재 userID가 가정됩니다.
현재 구현 된 AT 및 배치는 사용자가
리소스 경쟁. 이것이 귀하의 사이트의 경우라면
NQS와 같은 다른 배치 시스템을 고려하고 싶습니다.
작가
At는 대부분 Thomas Koenig가 작성했습니다.
2009-11-14 at (1)
형태 : at [옵션] {시간} // 해당 명령어 입력 후 at> 형태로 txt를 받을 수 있는 창이 열림
기능 : 예약한 시간에 입력한 명령어를 실행한다.
[옵션]
-l : 현재 실행 대기중인 명령의 전체 목록을 출력한다(atp와 동일), 내림차순 표기
-r [작업번호], -d [작업번호] : [작업번호]에 해당하는 실행 대기 명령을 삭제한다.(atrm과 동일)
-m : 출력 결과가 없더라도 작업이 완료되면 사용자에게 메일을 보낸다.
-f : 표준 입력 대신 실행할 명령을 파일로 지정한다.(특정 시간에 프로그램 실행)
-t : [[cc]yy]mmddhhmm[.ss] 형태로 시간을 표현할 수 있게 해준다.
cc : 년도의 앞자리로 생략할 경우 20xx을 기본값으로 사용한다.
yy : 년도의 뒷자리로 생략할 경우 현재의 년도를 기본값으로 사용한다.
mm : 몇월달인지 입력
dd : 며칠인지 입력
hh : 시간에 대한 입력
mm : 분에 대한 입력
[.ss] : .까지 모두 입력해야 하며 생략할 경우 지정한 분의 00초에 실행하게 된다.
{시간} : -t 옵션을 사용하지 않은 경우
- 특정 날짜에 대한 지정
{시간 [오전/오후]} [월 일 년도]
시간에 들어가는 데이터는 3가지로 구분하여 작성할 수 있다.
시간 타입에는 12시 표기법으로 오전 오후를 구분할 수 있으며 오전 오후에 대한 표기가 없다면 24시 표기법으로 인식한다
예시)
08:00 am == 20:00
08:00 == 08:00
혹은 : 없이 시간만 4자리를 입력할 경우 자동으로 24시 표기법으로 인식하여 am/pm를 입력하면 오류가 생긴다.
1234 == 12:34 pm
정각에 대한 표기를 하고 싶다면 숫자와 am/pm을 사용해주면 된다.
예시) 4pm, 5am, 12pm 등
만약 지금을 지정하고 싶을 때는 now를 사용하면 된다.
날짜에 대한 지정은 숫자를 사용하는 방법과 문자를 사용하는 방법이 있다.
- 문자를 사용하는 방법
해당 달과 일자를 같이 입력해줘야 하며, 달의 표기는 영어약어로, 일자는 숫자로 표기해줘야 한다.
년도에 대한 생략이 가능하며 생략할 경우 현재의 년도와 동일한 년도, 해당 날짜가 지났다면 내년으로 지정된다.
각 달별 영어 약어
| 1 | 2 | 3 | 4 | 5 | 6 |
| Jan(January) | Feb(February) | Mar(March) | Apr(April) | May(May) | Jun(June) |
| 7 | 8 | 9 | 10 | 11 | 12 |
| Jul(July) | Aug(August) | Sep(September) | Oct(October) | Nov(november) | Dec(December) |
예시 ) at 1750 jun 11 > 6월 11일 17시 50분 작업 예약
당연한 이야기지만 각 월별로 날짜가 존재하는 일자를 기록해야하며 특히 2월의 경우 29일의 존재여부를 신경써야한다.
헷갈릴 경우 달력을 확인해보자.
- 숫자를 사용하는 방법
해당 달과 일자, 년도를 모두 입력해줘야한다. 날짜의 표기는 6자 혹은 8자로 사용할 수 있다.
MMDD[CC]YY
MM/DD/[CC]YY
DD.MM.[CC]YY
[CC]YY-MM-DD.
약어는 -t 옵션에서 설명했던 내용과 동일하다
각 형태마다 날짜의 배치 순서가 다르니 형태에 맞춰서 사용하자.
- 현재시간을 기준으로 특정 시간 이후 작동
시간 [+일자]
시간
시간에 들어가는 데이터는 3가지로 구분하여 작성할 수 있다.
시간 타입에는 12시 표기법으로 오전 오후를 구분할 수 있으며 오전 오후에 대한 표기가 없다면 24시 표기법으로 인식한다
예시)
08:00 am == 20:00
08:00 == 08:00
혹은 : 없이 시간만 4자리를 입력할 경우 자동으로 24시 표기법으로 인식하여 am/pm를 입력하면 오류가 생긴다.
1234 == 12:34 pm
정각에 대한 표기를 하고 싶다면 숫자와 am/pm을 사용해주면 된다.
예시) 4pm, 5am, 12pm 등
만약 지금을 지정하고 싶을 때는 now를 사용하면 된다.
[+일자]
지정한 시간에서 추가하고 싶은 시간을 사용한다.
구체적인 시간에 대한 조정은 할 수 없으며 3일뒤, 2주뒤, 3년뒤 같은 간단한 추가만 가능하다
추가단위(s붙이던 안붙이던 같음)
+*day : *일 추가
+*week : *주 추가
+*month : *개월 추가
+*year : *연 추가
+tomorrow : 내일의 지정시
예외로 at tomorrow로 사용할 경우 자동으로 now +tomorrow 형태로 사용된다.
사용 예시. 이해를 돕기위해 행번호 추가
1) user1@user1 : ~$ at 16:16 Oct 10
2) warning: commands will be executed using /bin/sh
3) at Fri Oct 10 16:16:00 2025
4) at> ls -l > ~/Desktop/lslist.txt
5) at><EOT>
6) job * at Fri Oct 10 16:16:00 2025
1) at 명령 입력
2) 자동 출력
3) 요일/달/일/시간/년도 순으로 이 명령이 언제 실행되는지 자동 출력
4) 실행할 명령 및 리다이렉션 지정
5) 비어있는 at> 칸에서 ctrl + D를 눌러서 편집 종료
6) *번째 작업이 지정한 시간에 예약되었음을 자동출력
at 명령의 접근권한
/etc/at.allow : 해당 파일에 존재하는 사용자만 at 명령 사용 가능
/etc/at.deny : 해당 파일에 존재하는 사용자는 at 명령 사용 불가능
두개의 파일이 모두 존재하거나 allow 파일이 존재할 경우 등록된 사용자만 사용가능
두개의 파일이 모두 없다면 root만 at 명령을 사용가능(sudo at로 사용)
/etc/at.deny 가 빈 파일로 존재할 경우 모든 사용자가 at 명령어 사용 가능(초기 설정)
'IT 공부내용 정리 > Linux' 카테고리의 다른 글
| 리눅스 데몬(윈도우 서비스) (0) | 2025.03.14 |
|---|---|
| 터미널 명령어 - crontab 주기적인 반복 명령을 내리고 싶을 때 (0) | 2025.03.14 |
| 터미널 명령어 - nohup 내가 없어도 컴퓨터는 작업을 계속해야 할 때 (0) | 2025.03.14 |
| 터미널 명령어 - jobs 백그라운드 프로세스를 확인하고 싶을 때 (0) | 2025.03.14 |
| 리눅스 리다이렉션(>) - 결과값을 저장하거나 전달할 때 (0) | 2025.03.14 |