Hi Guys,
I am hoping someone can help me with the following error I get with the logrotate script.
My server is a less that a month old and everything is working well except the logrotate cron job.
Okay here is what is going on:-
logrotate gets run every day via cron.
The contents of my logrotate.conf is :-
I guess this will change my logs once a week.
Now when the week is up and my logs are due to be rotated. I get this error:-
If I check my logs, they have been incremented okay i.e. secure becomes secure.1
But the problem is that after the rotation the server writes the logs to the .1 file and not the secure file and the secure file stays at 0 bytes.
Note this is the same for all log files.
So basically although the logs do get rotated, the server writes to the .1 log after rotation and not the newly created log.
If I reboot the server all the logs are written to the base log files again untill the following week when it happens again.
Why on logrotation does the server not write to the new logs?
Many thanks with any help.
I am hoping someone can help me with the following error I get with the logrotate script.
My server is a less that a month old and everything is working well except the logrotate cron job.
Okay here is what is going on:-
logrotate gets run every day via cron.
The contents of my logrotate.conf is :-
Code:
# 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
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
Now when the week is up and my logs are due to be rotated. I get this error:-
Code:
error: error running shared postrotate script for /var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log
error: error running postrotate script
error: error running postrotate script
error: error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron
But the problem is that after the rotation the server writes the logs to the .1 file and not the secure file and the secure file stays at 0 bytes.
Note this is the same for all log files.
So basically although the logs do get rotated, the server writes to the .1 log after rotation and not the newly created log.
If I reboot the server all the logs are written to the base log files again untill the following week when it happens again.
Why on logrotation does the server not write to the new logs?
Many thanks with any help.