Cute Happy Ghost
본문 바로가기
server·network

linux crontab으로 6일 지난 파일들 삭제

by JENN_tech7 2022. 8. 9.
728x90
SMALL

- 해당 경로에 있는 파일들 중 6일 지난 파일들 삭제

find /data/log/web/ -type f -name '*' -mtime +6 -delete
find /data/log/web/gclog -type f -name '*' -mtime +6 -delete
find /data/log/web/nohup -type f -name '*' -mtime +6 -delete

 

 

- 매일 정각 스크립트 실행 crontab 설정

crontab -e 
0 0 * * * /data/app/clearLogAllDay.sh

 

 

 

- crontab 조회

crontab -l
728x90
LIST

댓글