2014-07-24 5 views
0

대답은 분명하지만 내 첫 logrotate 인스턴스를 실행하기 시작했습니다. 는 /etc/logrotate.d의 구성은 내가왜 logrotate는 오류를 발생시키지 않았습니까?

sudo /usr/sbin/logrotate -dvf /etc/logrotate.d/nginx 

으로 테스트 및 구성 파일을 읽는 다음있어 다음

/mnt/nginx/logs/access.log { 
     size 1k 
     dateext 
     missingok 
     rotate 10 
     compress 
     delaycompress 
     notifempty 
     create 640 root root 
     sharedscripts 
     postrotate 
       [ -f /opt/nginx/logs/nginx.pid ] && kill -USR1 `cat /opt/nginx/logs/nginx.pid` 
     endscript 
} 

/대한 구성 정보를 읽는 /etc/logrotate.d/nginx mnt/nginx/logs/access.log

Handling 1 logs 

rotating pattern: /mnt/nginx/logs/access.log forced from command line (10 rotations) 
empty log files are not rotated, old logs are removed 
considering log /mnt/nginx/logs/access.log 
    log needs rotating 
rotating log /mnt/nginx/logs/access.log, log->rotateCount is 10 
dateext suffix '-20140724' 
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' 
glob finding logs to compress failed 
glob finding old rotated logs failed 
renaming /mnt/nginx/logs/access.log to /mnt/nginx/logs/access.log-20140724 
creating new /mnt/nginx/logs/access.log mode = 0640 uid = 0 gid = 0 
running postrotate script 
running script with arg /mnt/nginx/logs/access.log : " 
       [ -f /opt/nginx/logs/nginx.pid ] && kill -USR1 `cat /opt/nginx/logs/nginx.pid` 
" 


Before test 
total 84K 
-rw-r--r-- 1 root root 51K Jul 22 15:05 access.log 
-rw-r--r-- 1 root root 24K Jul 15 17:02 error.log 


After test 
total 84K 
-rw-r--r-- 1 root root 51K Jul 22 15:05 access.log 
-rw-r--r-- 1 root root 24K Jul 15 17:02 error.log 

정확히 아무것도 변경되지 않았습니다. 그리고 그것은 오류를 불평하지 않았다. 도와주세요.

감사합니다.

답변

3

실수로했습니다.
-d 옵션을 사용하지 마십시오.
하지만 그걸로 행동하기 때문에, 왜 "마른"이라고 부르지 않을까요?

관련 문제