quak backup --verify re-hashes stored originals and downloads again any that do not match (closes #168)
check / check (push) Successful in 3m15s
check / check (push) Successful in 3m15s
`--verify`, or `lib.backup({ verify: true })`, hashes each original already
at its save path as the download check does, streamed, a live photo as
`<imageHash>:<videoHash>`. A mismatch is logged, removed and fetched again in
the same run; a failed fetch goes into `failures.json`. A file with no
recorded hash counts as unchecked. The result, the summary and `--json` gain
`verified`, `mismatched` and `unchecked`.
Judgement call: a stored original that cannot be read for hashing is recorded as failed and left in place.
Judgement call: the summary prints the three counts only with `--verify`.
Judgement call: the README's `BackupOptions` list does not name `verify`, to stay clear of #178's edit of that paragraph; Backup layout documents it.
Model: opus-5-5
This commit is contained in:
+5
-1
@@ -130,9 +130,13 @@ program
|
||||
)
|
||||
.argument("<dir>", "Output directory")
|
||||
.option("--json", "Print result as JSON instead of human-readable summary")
|
||||
.option(
|
||||
"--verify",
|
||||
"Re-hash stored originals and download again any that do not match",
|
||||
)
|
||||
// A backup usually runs from cron with nobody watching, so every request
|
||||
// it makes retries for longer than the other commands' requests do.
|
||||
.action((dir: string, opts: { json?: boolean }) =>
|
||||
.action((dir: string, opts: { json?: boolean; verify?: boolean }) =>
|
||||
run(
|
||||
backupCommand(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user