사용 버전 : Linux 우분투(레드햇 계열) 24.04.01 LTS 버전
사용한 시스템 지역/언어 : 대한민국/한글
man 원문
CRONTAB(1) General Commands Manual CRONTAB(1)
NAME
crontab - maintain crontab files for individual users (Vixie Cron)
SYNOPSIS
crontab [ -h]
crontab [ -u user ] [-n] file
crontab [ -u user ] [ -i ] { -e | -l | -r }
DESCRIPTION
crontab is the program used to install, deinstall or list the tables
used to drive the cron(8) daemon in Vixie Cron. Each user can have
their own crontab, and though these are files in
/var/spool/cron/crontabs, they are not intended to be edited directly.
If the /etc/cron.allow file exists, then you must be listed (one user
per line) therein in order to be allowed to use this command. If the
/etc/cron.allow file does not exist but the /etc/cron.deny file does
exist, then you must not be listed in the /etc/cron.deny file in order
to use this command.
If neither of these files exists, then depending on site-dependent con‐
figuration parameters, only the super user will be allowed to use this
command, or all users will be able to use this command.
If both files exist then /etc/cron.allow takes precedence. Which means
that /etc/cron.deny is not considered and your user must be listed in
/etc/cron.allow in order to be able to use the crontab.
Regardless of the existence of any of these files, the root administra‐
tive user is always allowed to setup a crontab. For standard Debian
systems, all users may use this command.
If the -h option is given, crontab shows a help message and quits imme‐
diately.
If the -u option is given, it specifies the name of the user whose
crontab is to be used (when listing) or modified (when editing). If
this option is not given, crontab examines "your" crontab, i.e., the
crontab of the person executing the command. Note that su(8) can con‐
fuse crontab and that if you are running inside of su(8) you should al‐
ways use the -u option for safety's sake.
The first form of this command is used to install a new crontab from
some named file or standard input if the pseudo-filename ``-'' is
given.
If the -n option is given, it means "dry run": crontab examines "your"
crontab for its syntax, and outputs a success message if this syntax is
correct, but nothing is written to any crontab.
The -l option causes the current crontab to be displayed on standard
output. See the note under DEBIAN SPECIFIC below.
The -r option causes the current crontab to be removed.
The -e option is used to edit the current crontab using the editor
specified by the VISUAL or EDITOR environment variables. After you
exit from the editor, the modified crontab will be installed automati‐
cally. If neither of the environment variables is defined, then the
default editor /usr/bin/editor is used.
The -i option modifies the -r option to prompt the user for a 'y/Y' re‐
sponse before actually removing the crontab.
DEBIAN SPECIFIC
The "out-of-the-box" behaviour for crontab -l is to display the three
line "DO NOT EDIT THIS FILE" header that is placed at the beginning of
the crontab when it is installed. The problem is that it makes the se‐
quence
crontab -l | crontab -
non-idempotent — you keep adding copies of the header. This causes
pain to scripts that use sed to edit a crontab. Therefore, the default
behaviour of the -l option has been changed to not output such header.
You may obtain the original behaviour by setting the environment vari‐
able CRONTAB_NOHEADER to 'N', which will cause the crontab -l command
to emit the extraneous header.
HIGHLIGHTING THE OUTPUT of crontab -l
The command crontab -l outputs plain text. When a tty can support ANSI
sequences to colourise this text, one can highlight the output, by
calling: crontab -l | spc -t crontab when the tty background is dark,
or crontab -l | spc -t crontab-light when this background is light.
The highlighting scheme can be modified by using customised versions of
files /etc/supercat/spcrc-crontab*
SEE ALSO
crontab(5), cron(8), spc(1)
FILES
/etc/cron.allow
/etc/cron.deny
/var/spool/cron/crontabs
The files /etc/cron.allow and /etc/cron.deny if they exist, must be ei‐
ther world-readable, or readable by group ``crontab''. If they are not,
then cron will deny access to all users until the permissions are
fixed.
There is one file for each user's crontab under the
/var/spool/cron/crontabs directory. Users are not allowed to edit the
files under that directory directly to ensure that only users allowed
by the system to run periodic tasks can add them, and only syntacti‐
cally correct crontabs will be written there. This is enforced by hav‐
ing the directory writable only by the crontab group and configuring
crontab command with the setgid bid set for that specific group.
STANDARDS
The crontab command conforms to IEEE Std1003.2-1992 (``POSIX''). This
new command syntax differs from previous versions of Vixie Cron, as
well as from the classic SVR3 syntax.
DIAGNOSTICS
A fairly informative usage message appears if you run it with a bad
command line.
cron requires that each entry in a crontab end in a newline character.
If the last entry in a crontab is missing the newline, cron will con‐
sider the crontab (at least partially) broken and refuse to install it.
The files under /var/spool/cron/crontabs are named based on the user's
account name. Crontab jobs will not be run for users whose accounts
have been renamed either due to changes in the local system or because
they are managed through a central user database (external to the sys‐
tem, for example an LDAP directory).
AUTHOR
Paul Vixie <paul@vix.com> is the author of cron and original creator of
this manual page. This page has also been modified for Debian by Steve
Greenland, Javier Fernandez-Sanguino and Christian Kastner.
4th Berkeley Distribution 19 April 2010 CRONTAB(1)
man 번역기 번역본
Crontab (1) 일반 명령 매뉴얼 Crontab (1)
이름
Crontab- 개별 사용자를위한 Crontab 파일 유지 관리 (Vixie Cron)
개요
Crontab [-h]
crontab [-u user] [-n] 파일
crontab [-u user] [-i] {-e | -L | -r}
설명
Crontab은 테이블을 설치, 탈출 또는 나열하는 데 사용되는 프로그램입니다.
Vixie Cron에서 Cron (8) 데몬을 운전하는 데 사용됩니다. 각 사용자는 가질 수 있습니다
그들 자신의 crontab, 그리고 이것들은 파일입니다
/var/spool/cron/crontabs는 직접 편집 할 수 없습니다.
/etc/cron.alow 파일이 존재하면 나열되어야합니다 (한 사용자
이 명령을 사용할 수 있도록 라인당). 만약
/etc/cron.alow 파일은 존재하지 않지만 /etc/cron.deny 파일은
존재하면 /etc/cron.deny 파일에 순서대로 나열되어서는 안됩니다.
이 명령을 사용합니다.
이 파일 중 어느 것도 존재하지 않으면 사이트 의존적 사기에 따라
형상 매개 변수, 슈퍼 사용자만이이를 사용할 수 있습니다.
명령 또는 모든 사용자 가이 명령을 사용할 수 있습니다.
두 파일이 모두 존재하면 /etc/cron.allow가 우선합니다. 이는 의미합니다
그 /etc/cron.deny는 고려되지 않으며 사용자는
crontab을 사용할 수 있도록 /etc/cron.alow.
이 파일의 존재에 관계없이 루트 관리
Tive 사용자는 항상 Crontab을 설정할 수 있습니다. 표준 데비안의 경우
시스템, 모든 사용자는이 명령을 사용할 수 있습니다.
-h 옵션이 제공되면 Crontab은 도움말 메시지를 표시하고 imme을 종료합니다.
대상.
-U 옵션이 제공되면 사용자의 이름을 지정합니다.
Crontab은 (목록시) 사용 또는 수정 (편집시)을 사용해야합니다. 만약에
이 옵션은 제공되지 않으며 Crontab은 "귀하의"Crontab을 검사합니다.
명령을 실행하는 사람의 Crontab. Su (8)는
Crontab을 퓨즈하고 SU (8) 내부에서 실행중인 경우 Al-
방법은 안전을 위해 -U 옵션을 사용합니다.
이 명령의 첫 번째 형태는 새 Crontab을 설치하는 데 사용됩니다.
일부 이름의 파일 또는 표준 입력``-''가
주어진.
-n 옵션이 주어지면 "Dry Run"을 의미합니다. Crontab은 "Your"를 검사합니다.
구문에 대한 Crontab 및이 구문이있는 경우 성공 메시지를 출력합니다.
정확하지만 크론 탭에 기록 된 것은 없습니다.
-L 옵션으로 인해 현재 크론 탭이 표준에 표시됩니다.
산출. 아래의 데비안에 대한 메모를 참조하십시오.
-r 옵션은 현재 크론 탭을 제거합니다.
-E 옵션은 편집기를 사용하여 현재 Crontab을 편집하는 데 사용됩니다.
시각적 또는 편집기 환경 변수에 의해 지정됩니다. 당신 이후
편집기에서 종료하면 수정 된 Crontab이 자동으로 설치됩니다.
칼리. 환경 변수 중 어느 것도 정의되지 않으면
기본 편집기/USR/BIN/편집기가 사용됩니다.
-i 옵션은 -r 옵션을 수정하여 사용자에게 'y/y're-를 프롬프트합니다.
실제로 Crontab을 제거하기 전에 Spons.
데비안 특정
Crontab -L의 "Out-the-Box"동작은 세 가지를 표시하는 것입니다.
"이 파일을 편집하지 마십시오"라인의 시작 부분에 배치 된 헤더
Crontab이 설치 될 때. 문제는 그것이 SE-
Quence
Crontab -l | Crontab -
비만-헤더의 사본을 계속 추가합니다. 이것은 원인입니다
sed를 사용하여 crontab을 편집하는 스크립트에 대한 통증. 따라서 기본값
-L 옵션의 동작은 그러한 헤더를 출력하지 않도록 변경되었습니다.
환경을 바꾸어 원래 동작을 얻을 수 있습니다.
crontab_noheader에 'n'을 할 수 있습니다.
외부 헤더를 방출합니다.
Crontab -L의 출력을 강조 표시합니다
명령 crontab -l은 일반 텍스트를 출력합니다. TTY가 ANSI를 지원할 수있는 경우
이 텍스트를 착용하기 위해 시퀀스, 출력을 강조 할 수 있습니다.
전화 : Crontab -l | spc -t crontab tty 배경이 어두울 때
또는 crontab -l | 이 배경이 가벼울 때 spc -t crontab -light.
강조 표시 체계는 사용자 정의 버전을 사용하여 수정할 수 있습니다.
파일/etc/supercat/spcrc-crontab*
참조하십시오
Crontab (5), Cron (8), SPC (1)
파일
/etc/cron.allow
/etc/cron.deny
/var/spool/cron/crontabs
/etc/cron.allow 및 /etc/cron.deny가 존재하는 경우 파일은 ei- 여야합니다.
세계에서 읽을 수 있거나 그룹``Crontab ''에 의해 읽을 수 있습니다. 그렇지 않은 경우
그러면 Cron은 권한이있을 때까지 모든 사용자에 대한 액세스를 거부합니다.
결정된.
각 사용자의 Crontab에 대해 하나의 파일이 있습니다.
/var/spool/cron/crontabs 디렉토리. 사용자는 편집 할 수 없습니다
해당 디렉토리 아래의 파일은 사용자 만 허용되도록
정기적 인 작업을 실행하려는 시스템은이를 추가 할 수 있으며 구문 만 추가 할 수 있습니다.
Cally 정확한 Crontabs가 작성됩니다. 이것은 Hav-에 의해 시행됩니다.
Crontab Group에서만 쓸 수있는 디렉토리 ing 및 구성
해당 특정 그룹의 SetGID 입찰 세트가있는 Crontab 명령.
표준
Crontab 명령은 IEEE STD1003.2-1992 (``POSIX '')를 준수합니다. 이것
새로운 명령 구문은 이전 버전의 Vixie Cron과 다릅니다.
클래식 SVR3 구문에서.
진단
나쁜 유익한 사용 메시지가 나쁘게 실행되면 나타납니다.
명령 줄.
Cron은 Crontab의 각 항목이 Newline 캐릭터로 끝나도록 요구합니다.
Crontab의 마지막 항목이 Newline이 없으면 Cron은 Con-
Crontab (적어도 부분적으로)을 깨뜨리고 설치를 거부합니다.
/var/spool/cron/crontabs 아래의 파일은 사용자의 이름을 기준으로합니다.
계정 이름. 계정이있는 사용자는 Crontab 작업이 실행되지 않습니다.
로컬 시스템의 변경으로 인해 이름이 바뀌거나
중앙 사용자 데이터베이스를 통해 관리됩니다 (SYS 외부 -
TEM, 예를 들어 LDAP 디렉토리).
작가
Paul Vixie <paul@vix.com>은 Cron의 저자이자 원래 제작자입니다.
이 설명서 페이지. 이 페이지는 Steve에 의해 데비안을 위해 수정되었습니다.
그린란드, 하비에르 페르난데스-냐노, 크리스티안 카스트 너.
4 차 버클리 배포 2010 년 4 월 19 일 Crontab (1)
형태
1 crontab -h : 간단한 도움말 출력
2 crontab [-u user] [-n] file : 기존 crontab 파일을 file 파일로 대체함.
3 crontab [-u user] [-i] {-l | -e | -r} : crontab 파일에 각 기능을 적용함.
옵션
[-u user] : 지정한 유저의 crontab 파일을 지정함. 생략한 경우 현재 로그온 한 대상의 crontab 파일을 지정함
-n : file 데이터를 검사하여 오류가 있는지 검사함
-l : crontab 파일에 있는 작업 목록을 보여줌
-e : crontab 파일을 수정함(edit)
-r : crontab 파일을 제거함
-i :-r 옵션을 실행하기 전 한번 더 확인함.
corntab은 지정 시간에 지정 행위를 하도록 하는 파일이다.
따라서 시간과 행위를 지정해주어야 한다.
mm hh dd MM 'ddd' [명령]
mm : 분
hh : 시
dd : 일자
MM : 월
'ddd' : 요일
[명령] : 리눅스에서 시행 가능한 명령
입력 요령
요일 :월요일 1 MON, 화요일 2 TUE, 수요일 3 WEN, 목요일 4 THU, 금요일 5 FRI, 토요일 6 SAT, 일요일 0,7 SUN
숫자 혹은 영문 약어를 기입
나머지 분,시,일자,월 에 대해서는
, : 특정 시점를 선별하여 지정
예시) 0,2,3,7
[기준숫자] / [증가숫자] : [기준숫자]부터 시작하여 [증가숫자]만큼 증가하는 때 시행
예시) 분에 3/2을 기록하면 3분에서 시작해서 매 1분마다 시행(4분
※crontab 에서 0/5와 */5는 동일한 취급
- : 좌우 숫자를 포함하는 기간
예시) 0-10 5-7 11-44
/와 -을 조합한 경우
[범위] / [증가숫자] : [범위] 내에서 [증가숫자]만큼 증가하는 때 시행
예시) 0-10/3 : 0부터 3씩 증가하는 때 시행 (0,3,6,9)
[명령]
[명령]은 리눅스에서 인식 가능한 명령을 기록하면 되며 리다이렉션 또한 포함된다.
만약 지속적인 기록 보관이 필요하다면 특정 파일에 대한 백업(파일 복사, 메일 전송 등)을 지시할 수 있다.
사용자 제한
/etc/cron.allow 파일과 /etc/cron.deny 파일이 존재할 경우 각각 화이트리스트, 블랙리스트를 담당하게 된다
allow 파일만 있거나 allow와 deny 파일이 둘 다 있는 경우는 allow파일에 등록된 유저만 crontab 기능을 사용할 수 있으며
deny 파일만 있는 경우 deny파일에 등록된 유저는 crontab 기능을 사용할 수 없다.
만약 둘 다 없다면 어느 유저나 자유롭게 crontab 기능을 사용할 수 있다.
'IT 공부내용 정리 > Linux' 카테고리의 다른 글
| 리눅스 데몬 관리 시스템 systemd (0) | 2025.03.14 |
|---|---|
| 리눅스 데몬(윈도우 서비스) (0) | 2025.03.14 |
| 터미널 명령어 - at 시간을 지정한 명령을 내릴 때(작업 예약) (0) | 2025.03.14 |
| 터미널 명령어 - nohup 내가 없어도 컴퓨터는 작업을 계속해야 할 때 (0) | 2025.03.14 |
| 터미널 명령어 - jobs 백그라운드 프로세스를 확인하고 싶을 때 (0) | 2025.03.14 |