본문 바로가기

쉘스크립트/Crontab(크론탭)

리눅스 부팅시 쉘 스크립트 실행하기

# 리눅스 부팅시 쉘 스크립트 실행하기

1. crontab 편집 모드로 들어간다.

crontab -e

2. @reboot 명령을 통하여 실행하고자 하는 스크립트 경로를 입력한다.

@reboot /home/test/test/programstart.sh

3. 저장한다.

아래의 매개변수를 사용하여 간단하게 적용 가능하다.

@reboot = run at boot and reboot only
@yearly  = run at midnight Jan 1 each year (equiv to 0 0 1 1 *)
@annually  = run at midnight Jan 1 each year (equiv to 0 0 1 1 *)
@monthly  = run at midnight on the first day of each month (equiv to 0 0 1 * *)
@weekly  = run at midnight each Sunday (equiv to 0 0 * * 0)
@daily  = run at midnight each day (equiv to 0 0 * * *)
@ midnight  = run at midnight each day (equiv to 0 0 * * *)
@ hourly = run on the first second of every hour (equiv to 0 * * * *)

- 끝 -

'쉘스크립트 > Crontab(크론탭)' 카테고리의 다른 글

Crontab 크론탭 설정  (0) 2022.04.19