Part of #162 (one cron-safe command that mirrors the whole account). Dispatched after #163 and #164 land, which change the same files.
What
Two backups of the same directory never run at once. A cron run that starts while the previous one is still going exits at once.
Definition of done
lib.backup() takes a lock in its download directory before its refresh and releases it when it finishes or throws.
A second backup of the same directory, from another process or the same one, while the first runs fails at once with an error naming the directory. quak backup prints it as one line and exits 2.
A lock left by a run that was killed is taken over by the next run without anyone removing it by hand.
README "Backup layout" names the lock file and says what it is for.
Tests: a second backup while one runs is refused; the lock is released after success and after a failure; a lock left by a killed run is taken over.
TODO.md: an entry at the top of Completed Steps.
Notes
Use proper-lockfile, the widely used package for this, pinned through yarn.lock as every dependency is. No hand-written PID file. The lock lives in the download directory and must not be mistaken for an original or touched by the album cleanup.
Part of https://git.eeqj.de/sneak/quak/issues/162 (one cron-safe command that mirrors the whole account). Dispatched after https://git.eeqj.de/sneak/quak/issues/163 and https://git.eeqj.de/sneak/quak/issues/164 land, which change the same files.
## What
Two backups of the same directory never run at once. A cron run that starts while the previous one is still going exits at once.
## Definition of done
- `lib.backup()` takes a lock in its download directory before its refresh and releases it when it finishes or throws.
- A second backup of the same directory, from another process or the same one, while the first runs fails at once with an error naming the directory. `quak backup` prints it as one line and exits 2.
- A lock left by a run that was killed is taken over by the next run without anyone removing it by hand.
- README "Backup layout" names the lock file and says what it is for.
- Tests: a second backup while one runs is refused; the lock is released after success and after a failure; a lock left by a killed run is taken over.
- `TODO.md`: an entry at the top of Completed Steps.
## Notes
Use `proper-lockfile`, the widely used package for this, pinned through `yarn.lock` as every dependency is. No hand-written PID file. The lock lives in the download directory and must not be mistaken for an original or touched by the album cleanup.
Touches `src/library/index.ts` (or `src/backup.ts`), `src/cli-commands.ts` (`backupCommand`), `package.json`, `yarn.lock`, tests, `README.md`, `TODO.md`.
Model: opus-5-5
clawbot
self-assigned this 2026-10-06 01:17:28 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #162 (one cron-safe command that mirrors the whole account). Dispatched after #163 and #164 land, which change the same files.
What
Two backups of the same directory never run at once. A cron run that starts while the previous one is still going exits at once.
Definition of done
lib.backup()takes a lock in its download directory before its refresh and releases it when it finishes or throws.quak backupprints it as one line and exits 2.TODO.md: an entry at the top of Completed Steps.Notes
Use
proper-lockfile, the widely used package for this, pinned throughyarn.lockas every dependency is. No hand-written PID file. The lock lives in the download directory and must not be mistaken for an original or touched by the album cleanup.Touches
src/library/index.ts(orsrc/backup.ts),src/cli-commands.ts(backupCommand),package.json,yarn.lock, tests,README.md,TODO.md.Model: opus-5-5