<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Something is spewing files on our box</title>
      <link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box/</link>
      <description>Comments on Ask MetaFilter post Something is spewing files on our box</description>
	  	  <pubDate>Wed, 17 Oct 2007 18:21:22 -0800</pubDate>
      <lastBuildDate>Wed, 17 Oct 2007 18:21:22 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Something is spewing files on our box</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box</link>	
  	<description>On our Linux web  server, for some reason /var/lib/php5 has filled up with files to the point that we can&apos;t even get a directory listing.  We are running out of inode space for the filesystem.  How can we get a directory listing to find out which files need to be removed, and remove them?</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2007:site.74064</guid>
  	<pubDate>Wed, 17 Oct 2007 18:14:03 -0800</pubDate>
  	<dc:creator>Dag Maggot</dc:creator>
	
	<category>linux</category>
	
	<category>systemadmin</category>
	
	<category>files</category>
	
	<category>inodes</category>
	
</item>
<item>
  	<title>By: eschatfische</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101874</link>	
  	<description>Does&lt;br&gt;
&lt;br&gt;
find /var/lib/php5&lt;br&gt;
&lt;br&gt;
not give you a listing?  If so, what&apos;s the error you get?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101874</guid>
  	<pubDate>Wed, 17 Oct 2007 18:21:22 -0800</pubDate>
  	<dc:creator>eschatfische</dc:creator>
</item>
<item>
  	<title>By: Dag Maggot</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101879</link>	
  	<description>Ah yes, that did it - thanks heaps!  Turns out they are php session files.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101879</guid>
  	<pubDate>Wed, 17 Oct 2007 18:32:39 -0800</pubDate>
  	<dc:creator>Dag Maggot</dc:creator>
</item>
<item>
  	<title>By: zengargoyle</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101885</link>	
  	<description>Stop the webserver.&lt;br&gt;
&lt;br&gt;
Try: &apos;find /var/lib/php5 -ls &amp;gt; /tmp/bad_dog_bad&apos;&lt;br&gt;
Look through the output in /tmp/bad_dog_bad.&lt;br&gt;
&lt;br&gt;
Then &apos;find -inode XXX -delete&apos;.&lt;br&gt;
&lt;br&gt;
You may have to read the man pages on &apos;find&apos; for some help.  Normal user stuff like &apos;ls&apos; tends to try and read everything and sort it or some such, &apos;find&apos; just reads the directory structure in &amp;quot;native&amp;quot; order without such stuff.&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
$ ls . | head&lt;br&gt;
001_Michael_Mills_02_Adam_Ant_and_Bow_Wow_Wow.mp3&lt;br&gt;
006.jpg&lt;br&gt;
016.jpg&lt;br&gt;
01_godspeed_you_black_emperor_storm.mp3&lt;br&gt;
02 Track 2.wma&lt;br&gt;
032.jpg&lt;br&gt;
034.jpg&lt;br&gt;
046.jpg&lt;br&gt;
04_dead_eyes.mp3&lt;br&gt;
059.jpg&lt;br&gt;
&lt;br&gt;
$ find . | head&lt;br&gt;
.&lt;br&gt;
./.bashrc&lt;br&gt;
./.bash_profile&lt;br&gt;
./.fluxbox&lt;br&gt;
./.fluxbox/keys&lt;br&gt;
./.fluxbox/menu&lt;br&gt;
./.fluxbox/init&lt;br&gt;
./.fluxbox/apps&lt;br&gt;
./.fluxbox/styles&lt;br&gt;
./.fluxbox/styles/Cthulhain&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Good luck!  &lt;br&gt;
&lt;br&gt;
(on preview, how do you make &amp;lt;pre&amp;gt; tags not double space?)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101885</guid>
  	<pubDate>Wed, 17 Oct 2007 18:36:11 -0800</pubDate>
  	<dc:creator>zengargoyle</dc:creator>
</item>
<item>
  	<title>By: fnord</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101916</link>	
  	<description>I&apos;ve always been partial to&lt;br&gt;
&lt;br&gt;
cd &lt;dir&gt;&lt;br&gt;
for i in *;do ls $i;done&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
That way it doesn&apos;t try to buffer it all into memory at once, it runs it a command at a time.  Pretty lightweight.&lt;br&gt;
I use it to comb through directories of 250,000+ files.&lt;br&gt;
&lt;br&gt;
Find can be kind of CPU intensive.&lt;/dir&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101916</guid>
  	<pubDate>Wed, 17 Oct 2007 19:05:08 -0800</pubDate>
  	<dc:creator>fnord</dc:creator>
</item>
<item>
  	<title>By: philomathoholic</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101930</link>	
  	<description>I wonder if &lt;code&gt;ls -U&lt;/code&gt; would work as well as find? (I don&apos;t have a large directory to test this on.) The &lt;code&gt;-U&lt;/code&gt; is &amp;quot;unsorted, directory order&amp;quot;. &lt;br&gt;
&lt;br&gt;
With preview, it looks like the &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; tags don&apos;t double space things.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101930</guid>
  	<pubDate>Wed, 17 Oct 2007 19:16:55 -0800</pubDate>
  	<dc:creator>philomathoholic</dc:creator>
</item>
<item>
  	<title>By: zengargoyle</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101932</link>	
  	<description>It is buffering it all into memory, it&apos;s just the shell that is doing the work, and it&apos;s not trying to sort the results.  &apos;for i in *&apos; will read the entire directory before it starts passing individual filenames to the &apos;ls&apos; command.&lt;br&gt;
&lt;br&gt;
&apos;for i in *; do ls $i; done&apos; will break most shells.  The shell will expand the &apos;*&apos; into a full list of files...  (and without the sorting that plain &apos;ls&apos; would do, &apos;echo *&apos; would accomplish the same thing).  If a plain &apos;ls&apos; wouldn&apos;t work, or take forever with tons of swapping, a &apos;for i in *&apos; wouldn&apos;t work either.  Same problem, has to read all of the files before it starts processing.   It&apos;s probably the sorting and swapping of memory that makes things grind to a halt.&lt;br&gt;
&lt;br&gt;
The beauty of &apos;find&apos; is that it works at a lower level.  It reads the directory inode, then it starts with the first file inode and processes, then on to the next file inode (or recurses into another directory inode).  &apos;find&apos; might take a long time, but it will always be faster than any other method, and use almost no memory.  &apos;find&apos; is your friend.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101932</guid>
  	<pubDate>Wed, 17 Oct 2007 19:19:04 -0800</pubDate>
  	<dc:creator>zengargoyle</dc:creator>
</item>
<item>
  	<title>By: zengargoyle</title>
  	<link>http://ask.metafilter.com/74064/Something-is-spewing-files-on-our-box#1101955</link>	
  	<description>WOW, seems &apos;ls -U&apos; is supreme.  (boring stuff follows).&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&lt;br&gt;
$ mkdir blah&lt;br&gt;
$ cd blah&lt;br&gt;
$ i=0; while true; do touch $i;i=$(( i + 1 )); done&lt;br&gt;
( wait a while and Ctrl-c)&lt;br&gt;
&lt;br&gt;
$ ls | sort -n | tail -1&lt;br&gt;
53296&lt;br&gt;
(number of files in this directory)&lt;br&gt;
&lt;br&gt;
$ time ls -Ui &amp;gt; /tmp/junk&lt;br&gt;
real    0m0.364s&lt;br&gt;
&lt;br&gt;
$ time find . &amp;gt; /tmp/junk&lt;br&gt;
real    0m0.399s&lt;br&gt;
&lt;br&gt;
$ time ls &amp;gt; /tmp/junk&lt;br&gt;
real    0m0.834s&lt;br&gt;
&lt;br&gt;
$ time find . -ls &amp;gt; /tmp/junk&lt;br&gt;
real    0m2.143s&lt;br&gt;
&lt;br&gt;
$ time for i in *; do ls $i; done &amp;gt; /tmp/junk&lt;br&gt;
real    4m24.637s&lt;br&gt;
&lt;br&gt;
$ time echo * &amp;gt; /tmp/junk&lt;br&gt;
real    0m1.375s&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
&apos;ls -Ui&apos; is now added to my cool fast things...    Never thought that &apos;ls -U&apos; would be faster than &apos;find .&apos;.&lt;br&gt;
&lt;br&gt;
(sorry, I spend too much time optimizing scripts.)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.74064-1101955</guid>
  	<pubDate>Wed, 17 Oct 2007 19:58:56 -0800</pubDate>
  	<dc:creator>zengargoyle</dc:creator>
</item>

    </channel>
</rss>
