Answer the question
In order to leave comments, you need to log in
Why doesn't logrotate run by cron?
There is a config for nginx log rotation:
/var/log/nginx/*.log {
size=100K
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1
endscript
}
* * * * * /usr/sbin/logrotate /etc/logrotate.d/nginx
Answer the question
In order to leave comments, you need to log in
Found an error. Didn't add the -f option .
* * * * * /usr/sbin/logrotate -f /etc/logrotate.d/nginx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question