(bugfix) Enable rsync progress output for live real runs
Default queued and management-command backups to verbose rsync output so live run views show progress for long-running real backups, matching dry-run visibility. Add a quiet-rsync escape hatch for operators who intentionally want less noisy real-run logs.
This commit is contained in:
@@ -19,6 +19,7 @@ class Command(BaseCommand):
|
||||
parser.add_argument("--prefix", default=settings.POBSYNC_HOME, help="Runtime state root")
|
||||
parser.add_argument("--dry-run", action="store_true", help="Run rsync --dry-run")
|
||||
parser.add_argument("--verbose-rsync", action="store_true", help="Write itemized rsync output to the run log")
|
||||
parser.add_argument("--quiet-rsync", action="store_true", help="Skip default rsync progress output for real runs")
|
||||
parser.add_argument("--prune", action="store_true", help="Apply retention after a successful run")
|
||||
parser.add_argument("--prune-max-delete", type=int, default=10)
|
||||
parser.add_argument("--prune-protect-bases", action="store_true")
|
||||
@@ -32,6 +33,7 @@ class Command(BaseCommand):
|
||||
except HostConfig.DoesNotExist as exc:
|
||||
raise CommandError(f"Missing enabled host {host_name!r}") from exc
|
||||
|
||||
verbose_output = bool(options["dry_run"] or options["verbose_rsync"] or not options["quiet_rsync"])
|
||||
run = BackupRun.objects.create(
|
||||
host=host,
|
||||
run_type=BackupRun.RunType.MANUAL if options["manual"] else BackupRun.RunType.SCHEDULED,
|
||||
@@ -39,7 +41,7 @@ class Command(BaseCommand):
|
||||
result={
|
||||
"requested": {
|
||||
"dry_run": bool(options["dry_run"]),
|
||||
"verbose_output": bool(options["dry_run"] or options["verbose_rsync"]),
|
||||
"verbose_output": verbose_output,
|
||||
"prune": bool(options["prune"]),
|
||||
"prune_max_delete": int(options["prune_max_delete"]),
|
||||
"prune_protect_bases": bool(options["prune_protect_bases"]),
|
||||
@@ -50,7 +52,7 @@ class Command(BaseCommand):
|
||||
run=run,
|
||||
prefix=paths.home,
|
||||
dry_run=bool(options["dry_run"]),
|
||||
verbose_output=bool(options["dry_run"] or options["verbose_rsync"]),
|
||||
verbose_output=verbose_output,
|
||||
prune=bool(options["prune"]),
|
||||
prune_max_delete=int(options["prune_max_delete"]),
|
||||
prune_protect_bases=bool(options["prune_protect_bases"]),
|
||||
|
||||
Reference in New Issue
Block a user