I am trying to accomplish the following assignment:
- 1. Rotate the /var/log/audit.log file if it hits 5MB (I will actually use a different size) in size (so that I can burn it to DvD and move it off of the HDD; there is not other option)
- 2. Also, if Monday morning 12:01am hits, rotate the log file even if the files is 1K in size; and
- 3. In either case mentioned above compress the file using bzip2 -9 to reduce its size on local disk
/var/log/audit/audit.log
{
weekly
dateext
compresscmd /usr/bin/bzip2
compressext .bz2
missingok
rotate 12
maxsize 5242880
sharedscripts
create 0600 root root
postrotate
/sbin/service auditd rotate
endscript
}
I have altered the /var/audit/auditd.conf value called max_log_file = 4096 (megabytes by the way).
So, after "configuring" all of this I executed the command: logrotate /etc/logrotate.d/audit
, but nothing actually happens - the file isn't rotated, there is no response on the screen except that the PS1 prompt returns, and I don't see anything in any logfiles anywhere.
Please help. I need to be able to rotate the audit.log file so that it it smaller than a DvD-media (hence the 4GB I want to use) and I want to deliberately rotate at the first minute of Monday every week so that I can archive the audit.log files from the past week (or month) and maintain space on the server and the workstations.
P.S. I am also centrally logging audit-data to the server and with success already; this is a precautionary measure to comply with some IT Governance rules and still maintain the system.
Thanks,