Cleaning the stats directory
yary
not.com at gmail.com
Wed May 21 12:26:06 EDT 2008
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.
More information about the Arguslist
mailing list