Subject: Cleaning the stats directory

From: yary <[email-masked]>
Date: Wed, 21 May 2008 09:26:06 -0700

While experimenting with argus, I've left behind many unneeded files in the
stats directory. Here's a few commands to clean it out-

cd /var/argus/stats (or wherever your argus data/stats directory is)
all one line:
argusctl list|tail +2|perl -pe
's/([\040%\#\+\\\;=\"\'"'"'\`\?\&~<>\/\000-\011\013-\037\177-\377])/sprintf("~x%02X",ord($1))/ges'>obj_list

 and a sanity check here. After creating obj_list, make sure the output of
these two commands is the same number:
  wc -l obj_list
  ls | fgrep -xf obj_list | wc -l
 to see what is going to be deleted:
  ls | fgrep -v -x -f obj_list

proceed to deletion-
ls | fgrep -v -x -f obj_list | xargs rm
rm obj_list

use with care, it's not perfect...  if there's a better way to clean out
this directory, let me know, I'm a rank beginner.

---

From: yary <[email-masked]>
Date: Wed, 21 May 2008 13:22:25 -0700

a simpler way is to remove files that haven't been modified recently,
since argus updates the statistics after running tests. Something like

find /var/argus/stats -mtime +1 -print0 | xargs -0 rm

is simpler than my last idea. It's also good in the gcache/gdata directories.

again, sorry for the bandwidth.