Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/logrotate.d/rsnapshot 추가 #8

Open
ibin79 opened this issue May 1, 2018 · 0 comments
Open

/etc/logrotate.d/rsnapshot 추가 #8

ibin79 opened this issue May 1, 2018 · 0 comments

Comments

@ibin79
Copy link
Collaborator

ibin79 commented May 1, 2018

개요

백업 에러 유무에 대한 정기 점검 시행시, 이미 해결된 과거 로그가 계속 노출됨

# grep ERROR /var/log/rsnapshot|tail
[2017-11-28T04:05:01] /usr/bin/rsnapshot daily: ERROR: rsnapshot can not continue. If you think an entry looks right, make
[2017-11-28T04:05:01] /usr/bin/rsnapshot daily: ERROR: sure you don't have spaces where only tabs should be.
[2017-11-29T04:05:01] /usr/bin/rsnapshot daily: ERROR: /etc/rsnapshot.conf on line 207:

조치

rsnapshot 은 1회성이 아닌 대부분 영구적인 설정, 디렉토리 미존재, 원격 서버 미접속 오류이므로 최근 로그만 확인하면 됨.

따라서 logrotate 를 통해, 주단위로 로그 파일을 백업하도록 안내

echo '/var/log/rsnapshot {
        rotate 52
        weekly
        compress
        missingok
}' > /etc/logrotate.d/rsnapshot

lograte 적용 결과

# ls -lt /var/log/rsnapshot*
-rw-r--r--. 1 root root 29621  5월  2 07:24 /var/log/rsnapshot
-rw-r--r--. 1 root root  2703  4월 28 10:28 /var/log/rsnapshot-20180429.gz
-rw-r--r--. 1 root root  2197  4월 21 10:26 /var/log/rsnapshot-20180422.gz
-rw-r--r--. 1 root root  2696  4월 15 09:15 /var/log/rsnapshot-20180416.gz
-rw-r--r--. 1 root root  6604  4월  7 18:58 /var/log/rsnapshot-20180408.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant