검색결과 리스트
apache accesslog에 해당되는 글 1건
- 2018.04.24 apache accesslog 삭제
글
[Good Comment!!, Good Discussion!!, Good Contens!!]
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
주저리
디스크가 Full이 났다.
보니 아파치 액세스로그가 엄청나게 쌓이고 있었다..
매번 쌓일때마다 지워줘야하니 짜증이-_-;;
그래서 찾아보았다. 아파치 httpd.conf에서 옵션으로 삭제가 가능한지를..
잘못찾겠다-_-; 그래서 그냥 쉘스크립트로 삭제를 하기로 맘먹었다.
쉘 스크립트로 처리
remove_apache_accesslog.sh라는 쉘을 하나 만들었다.
shell의 내용
#!/bin/bash # older than 1 days(수정 시간: mtime) find -daystart -type f -name "*.access_log" -mtime +1 -delete |
-daystart 옵션이 중요하다.
참고 사이트 : https://www.gnu.org/software/findutils/manual/html_node/find_html/Age-Ranges.html
크론탭 스케줄링 처리
크론탭 설정 (crontab -e)
# 아파치 액세스로그 삭제 0 1 * * * /acet/script/remove_apache_accesslog.sh >> /acet/script/remove.log 2>&1 |
'OS > Shell Script' 카테고리의 다른 글
if~else + 하루 이전 날짜 구하기! (0) | 2019.01.23 |
---|---|
apache accesslog 삭제 (0) | 2018.04.24 |
[삽질 스토리] ssh에 연결하면서 바로 shell 수행하기!! (0) | 2016.05.10 |
value too great for base (error token is 08 ) (0) | 2015.02.04 |
Shell Script DeBug Mode (0) | 2012.10.29 |
shell if 문법 (2) | 2012.02.09 |
:::: facebook을 이용하시는 분들은 로그인 후 아래에 코멘트를 남겨주세요 ::::