quak backup writes every original twice and precaches the whole account #106

Closed
opened 2026-09-23 05:34:58 +02:00 by clawbot · 1 comment
Collaborator

Problem

quak backup saves each original twice and fills the per-user cache while doing it.

  • runBackup gets each original through lib.original() (src/backup.ts:365-366). The content cache writes it into CACHE/originals/ (src/library/content.ts:469-474), and copyAtomic then copies it into DIR/originals/. A 500 GB account means 1 TB written, and up to 100 GiB of copies left in the per-user cache.
  • backupCommand opens the library with the default precache (src/cli-commands.ts:346-350). So a backup also downloads every thumbnail in the account, plus the favorites and last-week originals, into the cache. The one-shot commands turn this off on purpose (src/cli-commands.ts:94-105).

Definition of done

  1. During a backup, an original that is not already present is written straight into DIR/originals/ by the atomic writer. No second copy is made in the cache's originals directory. The cache still counts it as present, as it already does for backup files (src/library/content.ts:455-467).
  2. quak backup opens the library with the thumbnail and originals precache off.
  3. A test backs up N files with a counting byte source and shows one fetch per file, an empty cache originals/ directory afterwards, and every original in the backup tree.
  4. README lib.backup() text updated to match.
  5. make check green; TODO.md updated in the same commit.

Model: opus-5-5

## Problem `quak backup` saves each original twice and fills the per-user cache while doing it. - `runBackup` gets each original through `lib.original()` (`src/backup.ts:365-366`). The content cache writes it into `CACHE/originals/` (`src/library/content.ts:469-474`), and `copyAtomic` then copies it into `DIR/originals/`. A 500 GB account means 1 TB written, and up to 100 GiB of copies left in the per-user cache. - `backupCommand` opens the library with the default precache (`src/cli-commands.ts:346-350`). So a backup also downloads every thumbnail in the account, plus the favorites and last-week originals, into the cache. The one-shot commands turn this off on purpose (`src/cli-commands.ts:94-105`). ## Definition of done 1. During a backup, an original that is not already present is written straight into `DIR/originals/` by the atomic writer. No second copy is made in the cache's originals directory. The cache still counts it as present, as it already does for backup files (`src/library/content.ts:455-467`). 2. `quak backup` opens the library with the thumbnail and originals precache off. 3. A test backs up N files with a counting byte source and shows one fetch per file, an empty cache `originals/` directory afterwards, and every original in the backup tree. 4. README `lib.backup()` text updated to match. 5. `make check` green; `TODO.md` updated in the same commit. Model: opus-5-5
clawbot self-assigned this 2026-09-23 05:34:58 +02:00
Author
Collaborator

Built in #124: a backup now writes each fetched original straight into its own originals/ (the cache records it there, no second copy), and quak backup runs with the precache off.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/quak/pulls/124: a backup now writes each fetched original straight into its own `originals/` (the cache records it there, no second copy), and `quak backup` runs with the precache off. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/quak#106