[Vserver] clean-up hash directory

From: Corey Wright <undefined_at_pobox.com>
Date: Wed 06 Sep 2006 - 07:28:51 BST
Message-Id: <20060906012851.3240779e.undefined@pobox.com>

i was curious if vhashify cleaned up after itself (delete orphaned
instances of files in hash directory), and it appears it doesn't. these
commands should do the job. well, technically this just lists files with a
hardlink count of 1 and prints the total size in bytes of all listed files
on the last line (so you know how much space you are saving).

find /etc/vservers/.defaults/vdirbase/.hash/ -type f -printf "%n %s %p\n" |
grep '^1[[:space:]]' | awk '{ sum += $2; print $3 } END { print sum }'

to delete those listed files, add to the end:
   | while read FILE; do rm -f ${FILE}; done

does anybody see any problem with my logic?

corey

-- 
undefined@pobox.com
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Wed Sep 6 07:29:48 2006
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 06 Sep 2006 - 07:29:53 BST by hypermail 2.1.8