Browse Source

backup: only prune archives that match default naming pattern

master
Jim Paris 7 months ago
parent
commit
ed8ea15aa7
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      backup.py

+ 5
- 1
backup.py View File

@@ -417,19 +417,23 @@ def main(argv: typing.List[str]):
"--paths-delimiter", "\\0",
"::" + hostname + "-{now:%Y%m%d-%H%M%S}"],
stdin_writer=backup.run):

# backup success; run prune. Note that this won't actually free
# space until a "./borg.sh --rw compact", because we're in
# append-only mode.
backup.log('I', f"pruning archives", bold=True)
backup.run_borg([borg_sh,
"prune",
"--verbose",
"--list",
"--progress",
"--log-json",
"--stats",
"--keep-within=7d",
"--keep-daily=14",
"--keep-weekly=8",
"--keep-monthly=-1"])
"--keep-monthly=-1",
"--glob-archives", "hostname-????????-??????"])

# See if we had any errors
warnings = sum(1 for (letter, msg) in backup.logs if letter == 'W')


Loading…
Cancel
Save