Answer the question
In order to leave comments, you need to log in
How to configure logrotate correctly?
Due to the rapid growth in the size of log files, it is necessary to organize archiving and deletion of old log files.
For this I decided to use logrotate.
# /etc/logrotate.conf
/var/logs/*.log {
su root root
weekly
rotate 5
compress
delaycompress
missingok
notifempty
olddir /tmp/old_logs/
#sharedscripts
#postrotate
# find /tmp/old_logs/ -name “*.gz” -mtime +30 -print0 | xargs -0 rm -f
# endscript
}
Answer the question
In order to leave comments, you need to log in
I write the logs of each service in a separate folder, it's more convenient
/var/log/cron/, /var/log/maillog/, etc.
therefore, I don’t experience any difficulties in moving like you do,
and the su root root line is incomprehensible if logrotate is already started by root
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question