Koozali.org: home of the SME Server

how do i erase the logs from the server ?

compliance

how do i erase the logs from the server ?
« on: July 11, 2007, 03:17:25 AM »
how do i erase the logs from the server ??

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
how do i erase the logs from the server ?
« Reply #1 on: July 11, 2007, 09:54:26 AM »
Logrotate cron should do that for you.
"It should just work" if it doesn't report it. Thanks!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: how do i erase the logs from the server ?
« Reply #2 on: July 11, 2007, 03:59:27 PM »
Quote from: "compliance"
how do i erase the logs from the server ??


You can use the 'rm' command. But why do you want to erase logs?

compliance

erase logs
« Reply #3 on: July 11, 2007, 08:20:56 PM »
we want to erase them every week after we review them like a weekly procedure.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: erase logs
« Reply #4 on: July 11, 2007, 11:31:07 PM »
Quote from: "compliance"
we want to erase them every week after we review them like a weekly procedure.


You still haven't said why you want to erase them. You want to erase them because you want to erase them ...

compliance

erase logs, yes that's the reason, just erase them
« Reply #5 on: July 12, 2007, 12:50:19 AM »
no particular reason of why. i hope you can help.

Offline mmccarn

  • *
  • 2,651
  • +10/-0
how do i erase the logs from the server ?
« Reply #6 on: July 15, 2007, 04:58:04 PM »
Code: [Select]
rm -f /var/log/<logfilename>

If you're only reviewing log files weekly, be sure to check that your logs contain a weeks worth of data. Specifically, the qpsmtpd logs may contain as little as a few hours worth of data unless you have modified the default log settings (this is true of a system setup with SME 7.0 and subsequently updated to SME 7.1.3 without install the 'logterse' plugin).

The normal unix/linux way to do what you want would be to "rotate" the logs weekly (say every sunday night), then review the most recent rotated copies on Monday mornings.  If Monday is a holiday, your logs would still be there on Tuesday morning.  If you configure your log rotation to only keep one rotated log file the old logs would be deleted automatically the next Sunday when the next log rotation occurs.  (This is pretty easy for syslog, but may be tricky for multilog...)

The only multilog settings I have looked at are not 'templated' in SME, which means any customizations I introduce disappear whenever I install software updates...

You could write a script that runs daily or weekly to consolidate all the info you want to review into a single log file, then overwrite or delete that file each week after you review it.

SME rotates all logs by default as far as I know - your log files will not fill up your server.