This commit is contained in:
hubobel 2025-04-20 10:42:34 +02:00
parent 7918ee8d8e
commit 2fe8bad74c
2 changed files with 16 additions and 1 deletions

View file

@ -103,6 +103,7 @@ duration = end - start
os.remove(logfilepath) os.remove(logfilepath)
notify_telegram(("<b>Backup Statistics:</b>\n\n%s\n\n<i>Start Time</i>: %s\n<i>End Time</i>: %s\n<i>Duration</i>: %s minutes" % if duration.total_seconds() >6:
notify_telegram(("<b>Backup Statistics:</b>\n\n%s\n\n<i>Start Time</i>: %s\n<i>End Time</i>: %s\n<i>Duration</i>: %s minutes" %
("\n\n".join(result_msg), start.strftime("%Y-%m-%d %H:%M:%S"), end.strftime("%Y-%m-%d %H:%M:%S"), ("\n\n".join(result_msg), start.strftime("%Y-%m-%d %H:%M:%S"), end.strftime("%Y-%m-%d %H:%M:%S"),
divmod(duration.total_seconds(), 60)[0]))) divmod(duration.total_seconds(), 60)[0])))

14
test.py Normal file
View file

@ -0,0 +1,14 @@
import datetime
from time import sleep
start = datetime.datetime.now()
#sleep(5)
end = datetime.datetime.now()
duration = end - start
if duration.total_seconds() >6:
print('Ein Ereigniss')
else:
print('kein Ereigniss')
print(duration.total_seconds())
print(divmod(65, 60)[0], divmod(65, 60)[1])