update state file correctly
This commit is contained in:
parent
85a34d4e57
commit
168231779a
@ -4,4 +4,4 @@ CFG_DIR = os.environ.get("RESTICBACKUP_CONFIG_DIR", "/etc/resticbackup.d")
|
||||
RESTIC_BIN = os.environ.get("RESTICBACKUP_RESTIC_BIN_PATH", "restic")
|
||||
|
||||
|
||||
__version__ = "0.0.8"
|
||||
__version__ = "0.0.9"
|
||||
|
@ -164,7 +164,8 @@ def update_statefile(path, success):
|
||||
"success": bool(success),
|
||||
}
|
||||
)
|
||||
state = state[0:10]
|
||||
state.sort(key=lambda x: x["time"])
|
||||
state = state[-10:]
|
||||
|
||||
with open(path, "w") as f:
|
||||
json.dump(state, f, indent=4, sort_keys=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user