I have a log file a service of mine makes that has the filename "Feed1 - 1.stat". logrotate refuses to rotate this file, but only when run via cron. Running logrotate via the shell will rotate the file correctly. Changing the config and and log file to not have a space will also result in the file rotating correctly.
Heres the relevant part of the script script:
"/opt/myservice/statistics/continuous/Feed1 - 1.stat"
{
rotate 60
daily
missingok
notifempty
compress
delaycompress
postrotate
/usr/bin/killall -HUP myservice
endscript
}
And here's the cron entry that kicks off logrotate (Ubuntu default):
#!/bin/sh
# Clean non existent log file entries from status file
cd /var/lib/logrotate
head -1 status > status.clean
sed 's/"//g' status | while read logfile date
do
[ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean
mv status.clean status
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
I suspect something perhaps related to enviroment variables? I can see the cron enviroment is rather sparse, but don't know how to debug this from here on.
Any ideas? Thanks :-)
Ubuntu 11.04 Natty 64 bit
2.6.38-8-server
logrotate 3.7.8-6ubuntu3.1
Edits:
- Rewrote question as I found out it doesn't have to do with the wildcard matching