/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
Here are two logrotate.conf entries that I created:
/var/log/hellavcr.log {
ifempty
missingok
nomail
weekly
rotate 1
}
/var/log/hellanzbinit.log {
ifempty
missingok
nomail
daily
rotate 2
}
If I sudo as root and execute "/usr/sbin/logrotate hellanzb" the command executes without any errors. However, every time the cronjob "/etc/cron.daily/logrotate" runs I get a bunch of error messages:sh: line 2: missingok: command not found sh: line 3: nomail: command not found sh: line 4: weekly: command not found sh: line 5: rotate: command not found sh: line 2: ifempty: command not found sh: line 3: missingok: command not found sh: line 4: nomail: command not found sh: line 5: daily: command not found sh: line 6: rotate: command not foundI've checked the permissions for both the logrotate.conf files and the actual log files and they seems to be identical as far as my applications and Apache goes - so why the errors?
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
logrotate.conf has the following permissions:-rw-r--r-- 1 root root 520 Dec 1 2007 /etc/logrotate.confThe additional configuration files under /etc/logrotate.d/ have the following permissions:
-rw-r--r-- 1 root root 75 Feb 12 06:10 hellanzb -rw-r--r-- 1 root root 72 Feb 12 06:10 hellavcr -rw-r--r-- 1 root root 167 Nov 12 10:43 httpd
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
/var/log/rtorrentInit.log {
prerotate
/sbin/service rtorrent stop > /dev/null 2>/dev/null || true
missing an endscript here!ifempty missingok nomail daily rotate 2 postrotate /sbin/service rtorrent start > /dev/null 2>/dev/null || true endscript }I knew that posting the full error message would be useful for something!
You are not logged in, either login or create an account to post comments
posted by idiopath at 11:42 PM on March 21