NONE

NONE

Post by Hermen Lessche » Sat, 17 Feb 2001 18:55:29



Dear all,

I want to periodically save and empty the /var/log/messages file.
How do I do this correctly, I tried renaming the file, zipping it and touching a new messages file,
but after that all logging is not saved to the newly placed messages file (it remained empty).
What went wrong?

Thanks, Hermen

 
 
 

NONE

Post by Jeremia d » Sat, 17 Feb 2001 20:53:02



> Dear all,

> I want to periodically save and empty the /var/log/messages file.
> How do I do this correctly, I tried renaming the file, zipping it and touching a new messages file,
> but after that all logging is not saved to the newly placed messages file (it remained empty).
> What went wrong?

> Thanks, Hermen

Look into logrotate.
--
A little experience often upsets a lot of theory.

 
 
 

NONE

Post by Mark Po » Sun, 18 Feb 2001 11:48:42




Quote:>I want to periodically save and empty the /var/log/messages file.
>How do I do this correctly, I tried renaming the file, zipping it and touching a new messages file,
>but after that all logging is not saved to the newly placed messages file (it remained empty).
>What went wrong?

The system logger doesn't know about what you did, so it's still writing to
where it thinks the log file is/was.  In the future, you can do this:
 cp -p /var/log/messages /var/log/messages.currentdate
 >/var/log/messages

Mark Post

Postmodern Consulting
Information Technology and Systems Management Consulting
To send me email, replace 'nospam' with 'home'.