Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: matt001 on April 14, 2005, 12:43:11 AM

Title: Question about clearing log files
Post by: matt001 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---
Title: Re: Question about clearing log files
Post by: CharlieBrady 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.