<br><div class="gmail_quote">On Wed, Jun 25, 2008 at 2:21 PM, chase pettet &lt;<a href="http://chase.mp">chase.mp</a>@<a href="http://gmail.com">gmail.com</a>&gt; wrote:<br><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
import os, time, sys<br>current = time.time()<br>os.chdir(&quot;c:\BACKUPS\DEV1&quot;)<br><br>for f in os.listdir(&#39;.&#39;):<br>&nbsp; modtime = os.path.getmtime(&#39;.&#39;)<br>&nbsp; if modtime &lt; current - 30 * 86400:<br>
&nbsp;&nbsp;&nbsp; os.remove(f)<br></blockquote><div><br>I&#39;m not in a place where I can test anything at the moment, but the
first thing I always do in situations like this is to throw
print/logging statements all over the place so I can see what&#39;s going
on.&nbsp; (Slows it down terribly, but it&#39;s temporary, right?)<br><br>I would do something like this:<br><br>for f in os.listdir(&#39;.&#39;):<br>&nbsp; modtime = os.path.getmtime(&#39;.&#39;)<br>&nbsp; print f, modtime<br>
&nbsp; if modtime &lt; current - 30 * 86400:<br>&nbsp;&nbsp;&nbsp; print f, &quot;&nbsp; should be removed... is it?&quot;<br>
&nbsp;&nbsp;&nbsp; os.remove(f)<br><br>
At least it&#39;ll give you some idea of where things are going wrong.&nbsp; As I say, it&#39;s always the first thing I try.&nbsp; It&#39;s rarely the last.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is my first list post.&nbsp; Thanks for any help!<br>
</blockquote><div><br>Welcome to the list!&nbsp; Pull up a chair...</div></div><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a>