DevOps & Infra/OS
[Linux] Crontab 작성 후 저장
나른한댕댕이🐶
2022. 7. 16. 17:15
728x90
반응형
# 배경
crontab을 작성 후 저장을 하고 나오는데 제대로 저장이 되지 않았다!
# Crontab 작성 후 저장하기
1. Crontab -e로 작성하기
Crontab -e 명령어를 입력하면 바로 편집창이 뜬다.
예약 시간과 파일을 작성한다.
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
...
0 0 * * * /home/ubuntu/test.sh
2. Ctrl + X
- 누르면 다음과 같이 밑에 뜬다. 이때, "Y"를 누른다.
- file 저장에 대한 내용이 다음과 같이 뜬다. 그러면 그냥 ENTER를 눌러주면 저장 완료
3. Crontab -l 명령어로 저장된 내용 확인하기
$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
...
0 0 * * * /home/ubuntu/test.sh
728x90
반응형