logrotate - why ignore size ?

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

How do you know it's running properly when run manually? Did you check the output of either of these:

logrotate -d /etc/logrotate.conf # run in debug mode
logrotate -v /etc/logrotate.conf # run with verbose messages

Other than that I see 2 possible problems with your configuration:

/home/*/log/*log {
[...]
    create 0644 root webmasters
    sharedscripts
    postrotate
    size 3M
        kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
    endscript
}

Those 2 lines definitely have to be swapped.

logrotate.conf

[...]
# This doesn't belong in the global configuration, but in the
# per-log rules.
# create new (empty) log files after rotating old ones
create 0644 webmasters