<br><div class="gmail_quote">On Wed, Jun 25, 2008 at 2:21 PM, chase pettet <<a href="http://chase.mp">chase.mp</a>@<a href="http://gmail.com">gmail.com</a>> wrote:<br><div> </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("c:\BACKUPS\DEV1")<br><br>for f in os.listdir('.'):<br> modtime = os.path.getmtime('.')<br> if modtime < current - 30 * 86400:<br>
os.remove(f)<br></blockquote><div><br>I'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's going
on. (Slows it down terribly, but it's temporary, right?)<br><br>I would do something like this:<br><br>for f in os.listdir('.'):<br> modtime = os.path.getmtime('.')<br> print f, modtime<br>
if modtime < current - 30 * 86400:<br> print f, " should be removed... is it?"<br>
os.remove(f)<br><br>
At least it'll give you some idea of where things are going wrong. As I say, it's always the first thing I try. It'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. Thanks for any help!<br>
</blockquote><div><br>Welcome to the list! Pull up a chair...</div></div><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a>