Koozali.org: home of the SME Server

Question about clearing log files

matt001

Question about clearing log files
« on: April 14, 2005, 12:43:11 AM »
Can I use this code to clear any other log files except the Squid Log Files for example the dnscache log files.

Matthew

> ---start script ---
>
> #!/bin/bash
>
> LOGDIR=/var/log/squid
>
> cd $LOGDIR
> cp access.log access1.log
> cat /dev/null >access.log
> exit 0
>
> ---end---

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Question about clearing log files
« Reply #1 on: April 14, 2005, 02:32:57 AM »
Quote from: "matt001"
Can I use this code to clear any other log files except the Squid Log Files for example the dnscache log files.


Why do you want to do that?

The dnscache log files never grow beyond 5MB, and you never accumulate more than 10 of them. So they'll never chew up all your disk space. Same for all multilog managed log files.

If you don't like those numbers, you could change those numbers by editing /service/dnscache/log/run - use "sxxxxx" for the size of log file, and "nxx" for the maximum number of log files.