F18+ /var/log/messages safely clean/rotate

Joe Zeff joe at zeff.us
Wed May 1 08:28:42 UTC 2013


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.


More information about the users mailing list