윈도우에서 Apache 로그, Windows Firewall 로그 등 다양한 로그를 기가 단위로 쌓아가고 있는 내게 꼭 필요한 Tip
http://www.netadmintools.com/art228.html
윈도우 Batch 파일로 되어 있으므로 별도의 유틸리티가 필요하지 않다.
Log rotate 전에 잠시 서비스를 끄고, rotate가 끝나면 서비스를 재시작해주는 센스가 필요할 때도 있으니 주의!
---888---추가---888---
한글 윈도우에서 Apache 로그 로테이트 하기
@echo off
REM Stop Apache Service
net stop APM_APACHE2
REM Rotate access.log to access-YYYYMMDD.log
FOR %%V IN (access.log) DO FOR /F "tokens=1-3 delims=- " %%A IN ("%%~tV") DO move "%%V" "access-%%A%%B%%C%%~xV"
copy NUL access.log
REM Rotate error.log to error-YYYYMMDD.log
FOR %%V IN (error.log) DO FOR /F "tokens=1-3 delims=- " %%A IN ("%%~tV") DO move "%%V" "error-%%A%%B%%C%%~xV"
copy NUL error.log
REM Start Apache Service
net start APM_APACHE2
파일 : apm_logrotate.bat
이글루스 가든 - professional secur...

덧글