cancel
Showing results for 
Search instead for 
Did you mean: 

Directory Size

 
unix_hak
Occasional Visitor

Directory Size

Hi,

 

I have a directory that does indexing for an email application for spam, content,,etc....

Thousands of small files get written and deleted from this directory called 'new' and 'tmp'. When I first created this directory it was the default 512.

 

Now after 3 years its over a meg and 4 meg respectively. Although there are very few files in it at any one time.

So, How can I get this directory back to a 512 size without moving it, deleting it or re-creating it?  It's not an inode issue.

 

Thanks in advance.

 

# ls -al
total 11242
drwx------  11 pmx      pmx          512 Dec 18 11:42 .
drwxrwxr-x  17 pmx      pmx          512 May 15  2009 ..
-rw-r--r--   1 pmx      pmx            0 Feb  1  2010 .db.conf.gIlb4g
drwxr-xr-x   2 pmx      pmx          512 Mar 31  2012 Failed
drwxr-xr-x   3 pmx      pmx          512 Dec 18 05:27 Queue
drwxr-xr-x   3 pmx      pmx          512 Jun  6  2012 Sent
drwxr-xr-x   2 pmx      pmx          512 Dec 18 11:42 counters
drwxr-xr-x   5 pmx      pmx         2048 Dec 18 11:37 cur
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:42 db.conf
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:42 db.conf.1
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:41 db.conf.2
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:41 db.conf.3
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:40 db.conf.4
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:40 db.conf.5
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:39 db.conf.6
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:38 db.conf.7
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:38 db.conf.8
-rw-r--r--   1 pmx      pmx          178 Dec 18 11:37 db.conf.9
-rw-r--r--   1 pmx      pmx          329 May  6  2009 index.conf
drwxr-xr-x   2 pmx      pmx          512 Jun 30 03:05 mset
drwxr-xr-x   2 pmx      pmx      1555968 Dec 18 11:42 new
drwxr-xr-x   2 pmx      pmx      4158464 Dec 18 11:42 tmp
drwxrwx---   2 pmx      pmx          512 Sep 17  2011 trash
[/opt/pmx/var/qdir]# cd new
[/opt/pmx/var/qdir/new]#
[/opt/pmx/var/qdir/new]# pwd
/opt/pmx/var/qdir/new
[/opt/pmx/var/qdir/new]# ls | wc -l
       0
[/opt/pmx/var/qdir/new]# ls | wc -l
       2

2 REPLIES
Patrick Wallek
Honored Contributor

Re: Directory Size

Recreating the directories would be the easiest way to shrink the directory size.  

 

With the sizes you've given there were a LOT of files in those directories at some point in the past.

 

 

Dennis Handly
Acclaimed Contributor

Re: Directory Size

>How can I get this directory back to a 512 size without moving it, deleting it or re-creating it?

 

You are out of luck.  I don't think directories ever shrink.

Your application will need to take some downtime.