How to safely clean /var/log/messages for specific testing. or set it to hourly rotate. Couldn't see specific config in /etc/logrotate.d
Have tried "logrotate --force /var/log/messages" lots of "error: /var/log/messages:7137 unknown option 'May' -- ignoring line" I done want to nano "wipe the file" if possible
On 05/01/2013 12:52 AM, Frank Murphy wrote:
How to safely clean /var/log/messages for specific testing. or set it to hourly rotate. Couldn't see specific config in /etc/logrotate.d
Have tried "logrotate --force /var/log/messages" lots of "error: /var/log/messages:7137 unknown option 'May' -- ignoring line" I done want to nano "wipe the file" if possible
I remember, many years ago when there wasn't any logrotate. The advice then was to use this command to create a new file:
date > /var/log/messages
In your case, of course, moving the current version to a backup first would probably be best.
2013-05-01 09:52, Frank Murphy skrev:
How to safely clean /var/log/messages for specific testing. or set it to hourly rotate. Couldn't see specific config in /etc/logrotate.d
Have tried "logrotate --force /var/log/messages" lots of "error: /var/log/messages:7137 unknown option 'May' -- ignoring line" I done want to nano "wipe the file" if possible
Have you looked in /etc/logrotate.d/syslog?
On my F18 it contains:
$ more /etc/logrotate.d/syslog /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler { sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || t rue endscript } $ ls -l /var/log/messages* -rw-------. 1 root root 205769 1 maj 11.16 /var/log/messages -rw-------. 1 root root 1359 7 apr 03.48 /var/log/messages-20130407 -rw-------. 1 root root 180624 14 apr 03.37 /var/log/messages-20130414 -rw-------. 1 root root 160610 21 apr 03.21 /var/log/messages-20130421 -rw-------. 1 root root 2790 28 apr 03.50 /var/log/messages-20130428
On Wed, 01 May 2013 11:20:15 +0200 Jon Ingason jon.ingason@telia.com wrote:
Have you looked in /etc/logrotate.d/syslog?
On my F18 it contains:
$ more /etc/logrotate.d/syslog
/var/log/messages
Missed it, Will separate message from it, put it in it own conf and hope it keeps.
Am 01.05.2013 09:52, schrieb Frank Murphy:
How to safely clean /var/log/messages for specific testing. or set it to hourly rotate. Couldn't see specific config in /etc/logrotate.d
logotate does not work this way
/etc/logrotate.d/syslog /var/lib/logrotate.status
Have tried "logrotate --force /var/log/messages" lots of "error: /var/log/messages:7137 unknown option 'May' -- ignoring line"
no wonder - you gave it the logfile as con figuration
I done want to nano "wipe the file" if possible
Normally you simply type "> /var/log/messages" which finally mean "redirect nothing to the file" and since append would be >> it is cleared
On Wed, 01 May 2013 12:22:18 +0200 Reindl Harald h.reindl@thelounge.net wrote:
Normally you simply type "> /var/log/messages" which finally mean "redirect nothing to the file" and since append would be >> it is cleared
Thank you Harald, I'm still learning though middle aged.