<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: the most useful simple script i have</title>
	<atom:link href="http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/</link>
	<description>Casual Dismissals from Danny O'Brien</description>
	<lastBuildDate>Fri, 19 Feb 2010 06:17:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: L.</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-355</link>
		<dc:creator>L.</dc:creator>
		<pubDate>Wed, 03 Sep 2008 08:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-355</guid>
		<description>&quot;Lee&#039;s comment that mentions having a folder for items you&#039;re about to delete&quot;

...called the Trash on the Mac.

&quot;But really, using someone else’s already-written tool is the correct way of doing things&quot;

...which is why Waider and I use MacBooks.

Shouldn&#039;t -d be what does the delete, rather than the other way around, to help avoid accidental deletion? Imagine if you had to do rm rather than rm -fr to silently nuke everything... looking at the semantics of rm via its man page, we already have -v, but wouldn&#039;t -i be nice?</description>
		<content:encoded><![CDATA[<p>&#8220;Lee&#8217;s comment that mentions having a folder for items you&#8217;re about to delete&#8221;</p>
<p>&#8230;called the Trash on the Mac.</p>
<p>&#8220;But really, using someone else’s already-written tool is the correct way of doing things&#8221;</p>
<p>&#8230;which is why Waider and I use MacBooks.</p>
<p>Shouldn&#8217;t -d be what does the delete, rather than the other way around, to help avoid accidental deletion? Imagine if you had to do rm rather than rm -fr to silently nuke everything&#8230; looking at the semantics of rm via its man page, we already have -v, but wouldn&#8217;t -i be nice?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waider</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-347</link>
		<dc:creator>Waider</dc:creator>
		<pubDate>Mon, 01 Sep 2008 17:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-347</guid>
		<description>Hey, this horse won&#039;t move no matter how hard I beat it!

All the find variants are missing a pretty important flag: -depth. This avoids the need for fancy flags to rmdir, error messages about trying to traverse directories you just deleted, etc. But really, using someone else&#039;s already-written tool is the correct (and Henry Spencer-approved, &lt;a href=&quot;http://www.lysator.liu.se/c/ten-commandments.html&quot; rel=&quot;nofollow&quot;&gt;by implication&lt;/a&gt; (commandment #7)) way of doing things.</description>
		<content:encoded><![CDATA[<p>Hey, this horse won&#8217;t move no matter how hard I beat it!</p>
<p>All the find variants are missing a pretty important flag: -depth. This avoids the need for fancy flags to rmdir, error messages about trying to traverse directories you just deleted, etc. But really, using someone else&#8217;s already-written tool is the correct (and Henry Spencer-approved, <a href="http://www.lysator.liu.se/c/ten-commandments.html" rel="nofollow">by implication</a> (commandment #7)) way of doing things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-345</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Sun, 31 Aug 2008 22:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-345</guid>
		<description>You can mitigate funny characters in find with :
  find &quot;$tmpdir&quot; -type f -mtime +7 -print 0 &#124; xargs -0 rm -fv 


... which changes the seps in the find output to be nulls, and makes xargs expect null sep&#039;d items.</description>
		<content:encoded><![CDATA[<p>You can mitigate funny characters in find with :<br />
  find &#8220;$tmpdir&#8221; -type f -mtime +7 -print 0 | xargs -0 rm -fv </p>
<p>&#8230; which changes the seps in the find output to be nulls, and makes xargs expect null sep&#8217;d items.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny O'Brien</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-339</link>
		<dc:creator>Danny O'Brien</dc:creator>
		<pubDate>Sat, 30 Aug 2008 19:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-339</guid>
		<description>It looks like tmpwatch has been replaced (in fink and in Debian) with the package-most-like-an-EC-Comic, &lt;a href=&quot;http://packages.debian.org/sid/tmpreaper&quot; rel=&quot;nofollow&quot;&gt;tmpreaper&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>It looks like tmpwatch has been replaced (in fink and in Debian) with the package-most-like-an-EC-Comic, <a href="http://packages.debian.org/sid/tmpreaper" rel="nofollow">tmpreaper</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny O'Brien</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-338</link>
		<dc:creator>Danny O'Brien</dc:creator>
		<pubDate>Sat, 30 Aug 2008 19:11:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-338</guid>
		<description>Bluefoo gives pretty much the reason why it&#039;s in Python. After several iterations of writing it in find (and having spaces and strange characters mess things up), I just thought, screw it, this is ridiculous, I&#039;ll just spell it out s-l-o-w-l-y and methodically in Python, so at least I&#039;ll be able to understand what went wrong when it messes up. It&#039;s all part of my sinister plan to get good at one language, rather than know a little bit about a lot of them.

Of course, the best option of all is Waider&#039;s -- find somebody who has already done this for you. Thanks!</description>
		<content:encoded><![CDATA[<p>Bluefoo gives pretty much the reason why it&#8217;s in Python. After several iterations of writing it in find (and having spaces and strange characters mess things up), I just thought, screw it, this is ridiculous, I&#8217;ll just spell it out s-l-o-w-l-y and methodically in Python, so at least I&#8217;ll be able to understand what went wrong when it messes up. It&#8217;s all part of my sinister plan to get good at one language, rather than know a little bit about a lot of them.</p>
<p>Of course, the best option of all is Waider&#8217;s &#8212; find somebody who has already done this for you. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bluefoo</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-337</link>
		<dc:creator>Bluefoo</dc:creator>
		<pubDate>Sat, 30 Aug 2008 17:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-337</guid>
		<description>The find example above is reasonable, but instead of the -exec it may prove safer (with strange filenames) to use the extensions of GNU find.

find &quot;$tmpdir&quot; -type f -mtime +7 -delete
find &quot;$tmpdir&quot; -type d -exec rmdir &quot;{}&quot; \;

That should delete files not modified for 7 days and remove all old directories that are empty (or made empty by this process) since rmdir should only touch empty directories.  You may want to experiment with the -p option of rmdir to make sure you get all the parents otherwise depending on the find order you may have some left.</description>
		<content:encoded><![CDATA[<p>The find example above is reasonable, but instead of the -exec it may prove safer (with strange filenames) to use the extensions of GNU find.</p>
<p>find &#8220;$tmpdir&#8221; -type f -mtime +7 -delete<br />
find &#8220;$tmpdir&#8221; -type d -exec rmdir &#8220;{}&#8221; \;</p>
<p>That should delete files not modified for 7 days and remove all old directories that are empty (or made empty by this process) since rmdir should only touch empty directories.  You may want to experiment with the -p option of rmdir to make sure you get all the parents otherwise depending on the find order you may have some left.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-336</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Sat, 30 Aug 2008 14:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-336</guid>
		<description>@manu - my career has taken me away from hands-on scripting/programming but I was able to do so much with ksh and the sed/awk family that perl &amp; python were rarely necesary (for the sort of tasks I was trying to accomplish). I always like simple.</description>
		<content:encoded><![CDATA[<p>@manu &#8211; my career has taken me away from hands-on scripting/programming but I was able to do so much with ksh and the sed/awk family that perl &amp; python were rarely necesary (for the sort of tasks I was trying to accomplish). I always like simple.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Neukirchen</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-335</link>
		<dc:creator>Christian Neukirchen</dc:creator>
		<pubDate>Sat, 30 Aug 2008 12:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-335</guid>
		<description>A different approach, that works well for me who is paranoid (or romantic?) about keeping old stuff: http://chneukirchen.org/blog/archive/2006/01/keeping-your-home-clean-with-mess.html</description>
		<content:encoded><![CDATA[<p>A different approach, that works well for me who is paranoid (or romantic?) about keeping old stuff: <a href="http://chneukirchen.org/blog/archive/2006/01/keeping-your-home-clean-with-mess.html" rel="nofollow">http://chneukirchen.org/blog/archive/2006/01/keeping-your-home-clean-with-mess.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manu</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-333</link>
		<dc:creator>manu</dc:creator>
		<pubDate>Sat, 30 Aug 2008 10:28:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-333</guid>
		<description>Er, that&#039;s probably a stupid question, but why don&#039;t you just use find? That&#039;d be a one-liner:

&lt;code&gt;find &quot;$tmpdir&quot; -atime +7 -exec rm -r {} \;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Er, that&#8217;s probably a stupid question, but why don&#8217;t you just use find? That&#8217;d be a one-liner:</p>
<p><code>find "$tmpdir" -atime +7 -exec rm -r {} \;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waider</title>
		<link>http://www.oblomovka.com/wp/2008/08/29/the-most-useful-simple-script-i-have/comment-page-1/#comment-332</link>
		<dc:creator>Waider</dc:creator>
		<pubDate>Sat, 30 Aug 2008 09:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.oblomovka.com/wp/?p=1089#comment-332</guid>
		<description>gah, neglected to close that a tag. oh well.</description>
		<content:encoded><![CDATA[<p>gah, neglected to close that a tag. oh well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
