#!/usr/bin/env python3 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et import sys, os sys.path.insert(0, os.environ['HOME']+'/tld-ftp-admin/modules') import time from config import test_builds_dir, ftp_archs def clean_dir(path, max): curtime=time.time() for i in os.listdir(path): if curtime - os.path.getmtime(path+'/'+i) > max: os.unlink(path+'/'+i) for arch in ftp_archs + ['SRPMS']: clean_dir(test_builds_dir+arch, 60*60*24*3)