quak backup --verify re-hashes stored originals and downloads again any that do not match (closes #168)
check / check (push) Failing after 1m22s
check / check (push) Failing after 1m22s
`--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 put back in the
same run, and what is put back is hashed too, since a copy from the content
cache is not checked; one that still does not match, or 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: a copy put back that still does not match stays at its save path and is not counted as downloaded.
Judgement call: the summary prints the three counts only with `--verify`.
Model: opus-5-5
This commit was merged in pull request #179.
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