라즈베리 파이3 에서 crontab 을 사용한다. KT iot Makers 서버를 점검하거나 하면 웨더 스테이션을다시 리셋시켜야 정상적으로 데이터를 보낸다.
그래서 항상 밤 12시 1분에 웨더 스테이션을 다시 시작하도록 설정해야 한다.
crontab 파일이 생성되어 있는지 확인해보자
pi@raspberrypi:~ $ crontab -l
no crontab for pi
암것도 없다고 한다.
crontab 실행파일은 이미 설치되어 있으므로 crontab을 처음 실행하게 되면 아래처럼 에디터를 설정하는 화면이 나온다.
pi@raspberrypi:~ $ crontab -e
no crontab for pi - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
2. /bin/nano <---- easiest
3. /usr/bin/vim.tiny
Choose 1-3 [2]:
crontab: installing new crontab
pi@raspberrypi:~ $
여기서 crontab 파일을 수정한다.
pi@raspberrypi:~ $ crontab -e 하면 nano 에디터가 실행되어
파일이 열리는데 우리는 매일 밤 12시 1분에 재부팅하도록 설정하니 맨 아래에 다음과 같은 줄만 추가한다.
#은 주석이다.
# 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
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
#everyday night 0 si 1 boon reboot
1 0 * * * sudo reboot
수정했으면 ctrl-x 누르고 y 누르고 enter 를 눌러 빠져 나오면 아래와 같은 메세지가 나온다.
crontab: installing new crontab
pi@raspberrypi:~ $
자~ 이제 매일 밤에 부팅이 되어 kt 가 시스템 점검을 하더라도 다음 날이면 정상적으로 웨더 스테이션이 작동할것이다.

'개발자 > Raspberry Pi' 카테고리의 다른 글
| 라즈베리파이 삼바서버 접속과 설치 방법 - 원격 연결 (2) | 2025.09.03 |
|---|---|
| 라즈베리 파이 카메라 사용법과 mjpg 동영상 스트리밍 서버를 구현하기 (52) | 2019.10.11 |
| 모든 라즈베리 파이 기구 도면 정리 Raspberry Pi Dimension (0) | 2018.10.15 |
| 아두이노 메가 기구도면, 아두이노 기구도면, 아두이노 홀사이즈 (0) | 2018.06.01 |
| 강력한 시리얼 통신 프로그램 UART, Serial to USB 코드 (2) | 2018.02.09 |
| libpam-chksshpwd:armhf 에러 메시지 raspberry pi3 (1) | 2017.03.27 |
| wiringPi GPIO 설정 이렇게 초기화 된다. (0) | 2017.03.26 |
| Rapsberry Pi 3 Access Point 만들기 AP 만들기 (0) | 2017.03.23 |
취업, 창업의 막막함, 외주 관리, 제품 부재!
당신의 고민은 무엇입니까? 현실과 동떨어진 교육, 실패만 반복하는 외주 계약,
아이디어는 있지만 구현할 기술이 없는 막막함.
우리는 알고 있습니다. 문제의 원인은 '명확한 학습, 실전 경험과 신뢰할 수 있는 기술력의 부재'에서 시작됩니다.
이제 고민을 멈추고, 캐어랩을 만나세요!
코딩(펌웨어), 전자부품과 디지털 회로설계, PCB 설계 제작, 고객(시장/수출) 발굴과 마케팅 전략으로 당신을 지원합니다.
제품 설계의 고수는 성공이 만든 게 아니라 실패가 만듭니다. 아이디어를 양산 가능한 제품으로!
귀사의 제품을 만드세요. 교육과 개발 실적으로 신뢰할 수 있는 파트너를 확보하세요.
캐어랩