blob: 14c84d63e5e82370551c9502537cae7ca4ec512b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/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']+'/pld-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)
|