Ivo Chutkin wrote:
Hello,
I am collecting interface statistics with pfstat on OpenBSD 4.9.
Everything works fine except pfstat -t (days). The .db files getting big
so I want to clear old entries, unfortunately it does not work.
Here is what I do:
root@storage.
~ # du -h /var/db/pfstat.db
801M/var/db/pfstat.db
root@storage.
~ # /usr/local/bin/pfstat -t 30:45 -d /var/db/pfstat.db
root@storage.
~ # du -h /var/db/pfstat.db
801M/var/db/pfstat.db
root@storage.
~ #
The .db file is at least 6 months old, so there should be entries to
delete. I miss something obvious?
What did you expect, a smaller file ?
I'm not familiar with pfstat but I suppose you could check if the old
records still exist. If not, I suspect that, in general, when records are
deleted from a database, the actual storage isn't freed up. This way the
database program can reuse it for storing new records.
You could check if pfstat has an option to purge/shrink the database or
reclaim the database storage. Or maybe a tool exists to shrink a .db file.