Adjusted to account for the Clipboard folder being write protected. It couldn't be deleted, which errored everything out and stopped old files from being deleted. Also added OldFileChecker which, just checks if there are any files over 30 days old

This commit is contained in:
Dan
2021-09-23 00:10:41 -04:00
parent f19bfcc372
commit 7209093638
2 changed files with 40 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ if remoteOn is True:
for file in os.listdir(remote_path):
t = os.path.getmtime(remote_path + file)
age = (time.time() -t) / 86400
if age >= 30:
if age >= 30 and file != 'Clipboard':
os.remove(remote_path + file)
logging.info('-- Deleted %s', file)
else: