mcwalters
asked on
How to empty log file
I'm quite new to linux, and was wondering what is the best way to empty / archive a log file.
The file in question is /var/log/messages
I tried:
mv /var/log/messages /var/log/messages.archive. 07-09-2004
touch /var/log/messages to create new empty log file
but now nothing is being written to the logfile! How can I fix this and how should I have done it?
Thanks.
The file in question is /var/log/messages
I tried:
mv /var/log/messages /var/log/messages.archive.
touch /var/log/messages to create new empty log file
but now nothing is being written to the logfile! How can I fix this and how should I have done it?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it working now - it was
service syslog restart
Thanks
service syslog restart
Thanks
If you are worried about logsize try using a program like logrotate which cna be made to archive and compress log files automatically for you.
ASKER
service syslogd restart
but it doesn't recognise the service?