merci xabi...
darcs-hash:20060121154409-4ec08-1c063bbe44f1372e9b666a31a892cc5c3e92cef6.gz
This commit is contained in:
parent
9bf0de0226
commit
924fcf0ee6
1 changed files with 0 additions and 26 deletions
|
@ -1,26 +0,0 @@
|
||||||
#:! /usr/bin/env python
|
|
||||||
# -*- coding: iso8859-15 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
Petit script pour nettoyer les fichiers vieux de plus d'un an dans le
|
|
||||||
cimetière.
|
|
||||||
Executé par cron tous les jours sur vert
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os, time
|
|
||||||
|
|
||||||
datelimite = int(time.time()-365*24*60*60)
|
|
||||||
print datelimite
|
|
||||||
|
|
||||||
for dossier in ['/home/cimetiere/adherent',
|
|
||||||
'/home/cimetiere/club',
|
|
||||||
'/home/cimetiere/files',
|
|
||||||
'/home/cimetiere/machine']:
|
|
||||||
|
|
||||||
for fichier in os.listdir(dossier):
|
|
||||||
|
|
||||||
fichier = dossier+'/'+fichier
|
|
||||||
|
|
||||||
if os.path.getmtime(fichier)<datelimite:
|
|
||||||
print fichier
|
|
||||||
print os.remove(fichier)
|
|
Loading…
Add table
Add a link
Reference in a new issue