[root@localhost conf]# cat find.py ide
import osrem
import timeit
def listdir(path):class
for file in os.listdir(path):import
if os.path.isfile(path+"/"+file):file
ft = os.stat(path+"/"+file)im
ltime = int(ft.st_mtime)di
ntime = int(time.time())-3600*24*7view
if ltime<=ntime:vi
print "delete"+" "+path+"/"+file;
os.remove(path+"/"+file)
elif os.path.isdir(path+"/"+file):
listdir(path+"/"+file)
listdir('/home')