Added --cleanup arg

This commit is contained in:
Profitroll 2022-08-09 11:45:52 +02:00
parent 8039685e6b
commit 9cac021854
1 changed files with 14 additions and 11 deletions

View File

@ -23,6 +23,7 @@ if "--move-sent" in sys.argv:
logWrite(f"Could not move sent file '{entry}' to '{configGet('sent', 'locations')}' due to {exp}")
if "--cleanup" in sys.argv:
if "--confirm" in sys.argv:
for entry in jsonLoad(configGet("index", "locations"))["sent"]:
try:
try:
@ -35,6 +36,8 @@ if "--cleanup" in sys.argv:
pass
except Exception as exp:
logWrite(f"Could not remove '{entry}' due to {exp}")
else:
logWrite(f"Requested cleanup of sent files but not authorized. Please pass '--confirm' to perform that")
if "--norun" in sys.argv:
logWrite("Argument --norun passed, not running the main script")