질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

로그관련하여

작성자 정보

  • 이선주 작성
  • 작성일

컨텐츠 정보

본문

/var/log 아래에 있는 message와 xferlog 를 logrotate를 이용하여
하루에 한번이든 일주일에 한개씩 일련번호를 만들고 싶습니다.
여기강좌~ 책에 나와 있는대로 다 했는데도 되질 않아서요..
좀 봐주시면 감사하겠습니다.

당장 확인해 보려고 daily로 설정하였습니다.
# cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    daily
    create 0664 root utmp
    rotate 7
}

/etc/logrotate.conf 여기 상위에 있는 weekly와 rotate 4는
/etc/logrotatd.d/ 아래에 개별설정을 하면
해당사항 없다고 하더군요.

# cat /etc/logrotate.d/syslog
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
   daily
   nocompress
   rotate 7
   mail kagasi@paran.com
   errors kagasi@paran.com
   postrotate
     /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
   endscript

}


# cat /etc/logrotate.d/vsftpd.log
/var/log/xferlog {
   daily
   nocompress
   rotate 7

   mail kagasi@paran.com
   errors kagasi@paran.com
   postrotate
    /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
   endscript


}

그리고
/etc/crontab
에서 바로보기 위해
00 17 * * * root run-parts /etc/cron.daily
로 수정하였고,
/etc/rc.d/init.d/crond restart
/etc/rc.d/init.d/syslog restart 모두 해주고 확인 메세지
잘 나왔고
ps -ef | grep logrotate
ps -ef | grep syslogd

까지 다 제대로 있습니다.


현재 syslog에 설정되어 있는것이나, vsftpd.log에 설정한 것이나 모두 안돼고
전부 원래 있던 화일(message,vsftp.log)에 계속 누적됩니다.
message.1 xferlog.1 이렇게 생성되게 하고 싶습니다...

제가 어떤 설정이 틀린걸까요?? 아님 제가 멀 빼먹었나요?
봐주시면 정말 감사하겠습니다.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,300 명
  • 현재 강좌수 :  36,963 개
  • 현재 접속자 :  426 명