일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- android.view.WindowManager.BadTokenException
- material3
- isFinishing()
- dualthumbseekbar
- 원생성
- 듀얼시크바
- 안드로이드
- Python
- Java
- onIntercepterTouchEvent
- 안드로이드 다이얼로그 오류
- 지오코더
- Android
- 터치이벤트 순서
- databinding xml
- Could not find method
- 힐트
- [databinding]
- 도형생성
- 터치순서
- WindowManager$BadTokenException
- android compose
- {"msg":"cannot find method
- @provides @binds 차이
- rangeslider
- 레트로핏
- dispatchTouchEvent
- multiseekbar
- databinding error
- 원이동
- Today
- Total
개발관련일지
ubuntu 18.04 LTS - crontab 설정 본문
파이썬 beautifulSoup을 사용하여 뉴스 기사를 크롤링하는 파일을 특정 주기마다 실행 시키는 방법이 필요했다.
cron - 특정 시간이나 특정 시간 마다 해당 작업을 자동으로 스케줄링을 수행해주는 명령어, 도구
crontab - cron작업을 설정하는 파일을 crontab 파일이라함
동작방식 - cron이 부팅시 실행 > 데몬으로 백그라운드 실행 > 이벤트를 대기하다가 예정된 명령 실행
crontab관련 파일 위치 -
/usr/bin/crontab = 사용자별 크론탭 파일들 관리
/etc/crontab = 시스템 크론탭 파일
crontab 명령어 -
crontab -l >> 현재 등록되어져 있는 crontab 작업을 확인
crontab -e >> crontab의 설정된 편집기로 현재 사용자의 cron 작업을 확인 / 수정
crontab -r >> 사용자의 예약 작업을 모두 삭제
내가 설정해논 cron작업
root@ubuntu:# 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
#
# 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 comman
#SHELL = /bin/bash
#PATH = /sbin:/bin:/usr/sbin:/usr/bin
#HOME = /
0 15 * * 1-5 cd 파일위치 && /usr/bin/python3.6 get_news.py
시간 설정 - 나의 경우엔 15:00 평일에 크론작업 수행으로 설정
* 분 - (0 - 59)
* 시 - (0 - 23)
* 일 - (1 - 31)
* 월 - (1 - 12)
* 요일 - (0 - 6) > 0이 일요일
'개발기록 > LINUX' 카테고리의 다른 글
APACHE2] 시작명령어 에러 (0) | 2020.05.08 |
---|---|
vscode romote development ec2와 연결 (0) | 2020.05.06 |
LINUX ] 디렉토리 소유권 변경하기 (0) | 2020.04.22 |