[dns-operations] old dnscap files

Wessels, Duane dwessels at verisign.com
Fri Aug 16 16:51:16 UTC 2013


On Aug 15, 2013, at 11:27 PM, Randy Bush <randy at psg.com> wrote:

> i am much appreciative of dnscap, thanks duane.
> 
> but i just found over 90G of old dnscap files
> 
> -rw-r--r--  1 root  bind  10050111168 Apr 24  2011 dnscap.1303603200.000052
> -rw-r--r--  1 root  bind   8806596608 Apr 30  2011 dnscap.20110430.000000.000705.part
> -rw-r--r--  1 root  bind  14323680002 Jun 27  2011 dnscap.20110627.000000.000253
> -rw-r--r--  1 root  bind  28430699259 Dec 24  2011 dnscap.20111224.000000.001470
> -rw-r--r--  1 root  bind   5305923288 Aug 19  2012 dnscap.20120819.000000.000482
> -rw-r--r--  1 root  bind    257032192 Sep 16  2012 dnscap.20120916.000000.000046.part
> -rw-r--r--  1 root  bind   2291123167 Nov  5  2012 dnscap.20121105.000000.003768
> -rw-r--r--  1 root  bind  12004983019 Nov 27  2012 dnscap.20121127.000000.000059
> -rw-r--r--  1 root  bind   8816394240 Jan 10  2013 dnscap.20130110.000000.002266.part
> -rw-r--r--  1 root  bind   4846925267 Apr 12 03:37 dnscap.20130412.000000.000479
> -rw-r--r--  1 root  bind   7388545024 Aug 16 06:20 dnscap.20130816.000000.000911.part
> 
> is there some cool arg or cron job to clean up, or do i just find xx
> -mtime and rm?


There is no cool command unfortunately.  I use a cron script like this to remove oldest files first:

#!/bin/sh
set -e
. /etc/sysconfig/dnscap

cd `dirname ${DNSCAP_BASEPATH}`
while sleep 1 ; do
	GB_FREE=`df -B 1G . | awk 'NR==2 {print $4}'`
	echo $GB_FREE GB free | logger
	test $GB_FREE -gt ${DNSCAP_FREE_GB} && break;
	ls -rt | grep '^dnscap\.' | head -n 1 | xargs rm -v 2>&1 | logger
done




More information about the dns-operations mailing list