반응형
CRON 표현이란
CRON 은 리눅스와 유닉스 기반 시스템에서 사용되는 예약 작업 스케줄러이다.
CRON 은 미리 정의된 일정에 따라 주기적으로 또는 일회성으로 명령을 실행하도록 설정가능.

특히 AWS 사용할 때 CRON 표현식을 자주 이용된다!
Syntax
CRON 의 표현은 다음과 같이 5개의 필드로 구성된다.
[분] [시] [일] [월] [요일]
| Field | Value | Wildcards |
| 분 Minutes | 0 - 59 | , - * / |
| 시 Hours | 0 - 23 | , - * / |
| 일 Days of the month | 1 - 31 | , - * ? / L W |
| 월 Months | (1 - 12) or (Jan, Feb, Mar, etc.) | , - * / |
| 요일 Days of the week | (0 to 7) or (Sun, Mon, Tue, etc.) | , - * ? L # |
| 년 Years | 1970 - 2199 (optional) | , - * / |
Wildcard 란?
| Wildcards | Meaning | Example |
| * (asterisk) | includes all values in the field | " * * * * *" 는 매 분 매 시간 매일 매월 매요일에 해당하는 모든 값을 나타냅니다. |
| / (forward slash) | a step value | "*/5"는 5분마다 한 번씩을 나타냅니다. |
| , (comma) | a list of values | "0,15,30,45"는 0, 15, 30 및 45를 나타냅니다. |
| - (dash) | a range of values | "1-5"는 1부터 5까지의 값을 나타냅니다. |
| ? (question mark) | no specific value | in the days of the week field when the day of the month is specified (or vice versa) |
| L | the last occurrence of a day of the week or month | |
| W | the nearest weekday to a given day of the month |
예시) 매일 2:30 AM
30 2 * * *
예시) 매주 일요일
"0 0 * * 0"
예시) 매 15분마다 실행
"*/15 * * * *"
반응형
'클라우드(AWS)' 카테고리의 다른 글
| [AWS] Serverless 란 쉽게 개념 정리 (0) | 2023.10.07 |
|---|---|
| [AWS 보안] Security Group 와 Network ACL 차이점 쉽게 정리 (보안그룹, NACL: Network Access Control List) (0) | 2023.10.05 |
| What is AWS CodePipeline (CodeCommit, CodeBuild, CodeDeploy) (0) | 2023.04.27 |
| [AWS] [Elastic Container Service] ECS의 구조와 특징 쉽게 이해하기 (0) | 2023.03.28 |
| [AWS] [ECS] Task Role vs. Execution Role 차이 (2) | 2023.03.28 |