diff --git a/main.py b/main.py index 08310ca..7420ea1 100644 --- a/main.py +++ b/main.py @@ -24,9 +24,15 @@ if remoteOn is True: for file in os.listdir(local_path): t = os.path.getmtime(local_path + file) age = (time.time() - t) / 86400 - if age >= 7: + if age >= 3: shutil.move(local_path + file, remote_path + file) logging.info('-- Moved %s', file) + for file in os.listdir(remote_path): + t = os.path.getmtime(remote_path + file) + age = (time.time() -t) / 86400 + if age >= 30: + os.remove(remote_path + file) + logging.info('-- Deleted %s', file) else: print('Not connected') logging.info(' -- Error - Server Not connected')