Running CentOS 7 and have several logrotate scripts. For the past several days I've noticed it hasn't rotated my files. When I check logrotate.status it says it ran, but my logs are indeed not rotated. Forcing them to run manually it works as expected. I have a postrotate script that is suppose to copy the newly rotated file into another folder for processing but that doesn't happen. I'm new to linux but logrotate seems like it should be straight forward yet has caused my countless headaches trying to make this work reliably.
Update: I checked the context of those logrotate configs and all mine said "unconfined_U" while all the existing ones said "system_u". I've updated their context to match the others. Not sure if this will fix my issues but it's the only difference I've found so far.
/pub/share/mylog.log
{
su root root
missingok
create
dateext
daily
rotate30
compress
delaycompress
postrotate
cp $1-$(date +%Y%m%d) /pub/share/reports/mylog.log > /dev/null
endscript
}
I don't know if it's a permission issue or what.