For various reasons I decided to rebuild my log server on a new microSD. To simplify matters I restored a backed up copy of the appropriate config files and uploaded them to the new log server once syslog-ng was setup. The issue I am running into now is when logrotate compresses the log file it compresses the file and either creates or leaves another one that 0 bytes.
In the syslog-ng file below I have tried to add nocreate and copytruncate and that didn't change a thing.
Reviewing the logrotate.conf file I see no indication of either create or copytruncate being uncommented. There has only been one day that the 0 byte file wasn't created and that was when I uncommented "create" saved and restarted syslog-ng and commented it out saved and restarted syslog-ng but it came back the nexdt night.
Why is this file being left/created? Am I missing a file somewhere or is there something in the config that causing this issue. I also do not have this provlem on the log server that the config files were copied from which is why i am at a loss. I don't want to just
logrotate is awful.
does not well enough clarify boarder cases.
Try to add sharedscripts
This ensures that the postrotate action occurs once.
It work as well (or even better) to replace postrotate with lastaction (then you do not need sharedscripts).
This User Gave Thanks to MadeInGermany For This Post:
Hi all !
I've an issue to exclude a log file from logrotate, I tried this below:
/var/log/apache2/*.log {
olddir /var/log/apache2/old
missingok
rotate 50
compress
copytruncate
notifempty
create 644 root root
}
I tried also:... (0 Replies)
Hi Guys -
We have the /var/adm/pacct file currently configured to log rotate using logadm - here is the entry in logadm.conf:
/var/adm/pacct -C 0 -N -P 'Wed Oct 23 08:00:00 2013' -a '/usr/lib/acct/accton pacct' -g adm -m 664 -o adm -p never
Just want to ask if it would like possible to... (1 Reply)
Hi Admins.
I have installed logrotate rpm on Aix 6.1.
After the installation of rpm, I don't find /etc/logrotate.conf file and /etc/logrotate.d dir .
The config file is located in /opt/freeware/etc/logrotate.conf.
When I ran
logrotate -v /opt/freeware/etc/logrotate.conf
I get below... (2 Replies)
I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest.
I am using below command... (5 Replies)
I am having a requirement to rotate the my application logs dailay as it is keep on writiing to single file and below is the logrotate function which I am using,
cat /apps/bmc/bmtm/QPasa_logrotate.conf
/apps/bmc/bmtm/all_events.log /apps/bmc/bmtm/history_association.log {
missingok
... (1 Reply)
Hi,
How to give file name for the zip file while compressing in logrotate...
Should we need to give it in the logrotate.conf file or in the spec file...? (2 Replies)
Hi there,
I want to rotate the logfiles which are located in /var/log/jboss/tomcat*
so I have created a file named as 'tomat' in /etc/logrotate.d/tomcat with the following content.
# cat /etc/logrotate.d/tomcat
/var/log/jboss/tomcat_access_log*.log {
daily
nocreate
... (2 Replies)
Hi All
Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE.
Please suggest me something.
Thank's and regards
Vinay (1 Reply)
In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server.
For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match.
Please... (4 Replies)