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
|
# License could be found in full text on gnu.org/licenses
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import json
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -68,6 +69,18 @@ def main():
|
||||||
# Main loop ( 30 seconds intervals )
|
# Main loop ( 30 seconds intervals )
|
||||||
|
|
||||||
while True:
|
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...")
|
print("Counting another 30 seconds...")
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
print("Checking for changed files...")
|
print("Checking for changed files...")
|
||||||
|
|
Loading…
Add table
Reference in a new issue