Hi, i have a logroate script that works properly when running manually but otherwise it won't work.I put in in /etc/logrotate.d/nginx. I simply cannot understand why it won't run properly when run with a cronjob. It suppose to run hourly and rotate logs if they are > 3mb. What am i missing here ?:
/home/*/log/*log {
hourly
rotate 2
dateext
missingok
notifempty
create 0644 root webmasters
sharedscripts
postrotate
size 3M
kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
endscript
}
My logrotate.conf
# see "man logrotate" for details
# rotate log files daily
daily
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create 0644 webmasters
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
# system-specific logs may be configured here