Submitted by responsiveny on Thu, 04/23/2015 - 09:57
Hi,
I don't think log file rotation is working for the web access and error logs in /var/log/virtualmin. How can I troubleshoot this to see why I don't see any zipped files in there?
Status:
Active
Comments
Submitted by JamieCameron on Thu, 04/23/2015 - 18:56 Comment #1
Do you see any files with numeric extensions, like .0 or .1 ?
Submitted by responsiveny on Thu, 04/23/2015 - 19:29 Comment #2
No unfortunately only the _access_log and _error_log for each Virtual Server. No other files.
Submitted by JamieCameron on Thu, 04/23/2015 - 23:03 Comment #3
Try SSHing in as
root
and running the command :logrotate -d -f /etc/logrotate.conf
and see if it reports any errors. This command will do a test log rotation without actually modifying any files.
Submitted by responsiveny on Fri, 04/24/2015 - 12:00 Comment #4
I am seeing a bunch of these in the output. There might be other issues, but this is something that seems like it needs to be corrected. This is happening for all of the Virtual Servers.
Ignoring example.com.conf because of bad file mode.
Submitted by responsiveny on Fri, 04/24/2015 - 12:06 Comment #5
I just checked and all of the conf files in /etc/logrotate.d seem to have the file mode of 750. It seems they should be 644? How would that happen?
Submitted by responsiveny on Fri, 04/24/2015 - 12:28 Comment #6
I think I fixed it. I corrected the file modes and ran logrotate (had to use the -f switch) and it rotated all of the web access and error logs.
Follow up question:
Now that the logs are rotated, can I move them off of the server with no effects on anything? For example., has awstats already "used" them? Or does awstats refer to them when looking at a report?
Submitted by JamieCameron on Fri, 04/24/2015 - 18:55 Comment #7
You can remove rotated logs, as they should have been already incorporated into awstat's own data files.