Backup alert!
This commit is contained in:
parent
eea4006eff
commit
7368fe85cf
1 changed files with 13 additions and 0 deletions
|
@ -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...")
|
||||
|
|
Loading…
Reference in a new issue