Commit 99ff89ec authored by aoh's avatar aoh
Browse files

Add cron script for removing unused files

Signed-off-by: aoh's avataraoh <>
parent 4275b93f
Pipeline #355 failed with stages
#!/usr/bin/env python3
import os
from db import DB
for f in os.listdir(path):
remove = True
with DB() as d:
for id in d.get_domain_ids():
if f == d.get_domain_name(id):
remove = False
if remove:
print("Remove file {}".format(f))
# TODO actual file removal
# TODO logging?
os.unlink(path + f)
print("Keep file {}".format(f))
# TODO actual file keepal
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment