Backup alert!

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2023-02-26 17:42:58 +00:00
parent eea4006eff
commit 7368fe85cf

View file

@ -9,6 +9,7 @@
# License could be found in full text on gnu.org/licenses
import os
import json
import sys
import time
import hashlib
@ -68,6 +69,18 @@ def main():
# Main loop ( 30 seconds intervals )
while True:
try:
with open(project+"/backup_data.json") as f:
backup_data = json.load(f)
except:
backup_data = {}
backup_data["lastcheck"] = int(time.time())
with open(project+"/backup_data.json", "w") as f:
json.dump(backup_data, f, indent=4)
print("Counting another 30 seconds...")
time.sleep(30)
print("Checking for changed files...")