[IMP]Backup rsync global : only 2 days, 2 weeks, 6 months

This commit is contained in:
Fabien BOURGEOIS 2019-05-23 11:09:39 +02:00
parent 3226864b18
commit 7bbdb5aae2

View File

@ -50,14 +50,12 @@ def notkeep(fname):
ds = ds[0]
d = datetime.strptime(ds, '%Y-%m-%d')
delta = dt - d
if delta.days > 365:
if delta.days > 180:
return True
elif delta.days > 31:
# if (delta.days %% 30) != 0:
elif delta.days > 15:
if (d.day != 1):
return True
elif delta.days > 2:
# if (delta.days %% 7) != 0:
if (d.weekday() != 0) and (d.day != 1):
return True
else: