Skip to content

Reconcile

rhoopr edited this page May 18, 2026 · 4 revisions

reconcile

Detect assets the state DB thinks are downloaded but are missing from disk, and mark them for re-download on the next sync.

Usage

# Preview what would change (safe, no writes)
kei reconcile --dry-run

# Apply: flip every missing file's row to status=failed
kei reconcile

What it does

For each asset with status = 'downloaded' in the state DB, check whether the recorded local_path still exists on disk. If the file is gone, mark the row as failed. The next kei sync retries it through the normal failed-asset path and re-downloads the file.

When to run it

  • After manually moving, renaming, or deleting photos from the download directory.
  • After restoring from a partial backup where not every file came back.
  • After an external tool reorganized the tree (dedupers, migration scripts).
  • When kei status reports fewer files on disk than the DB expects.

Safety

  • Never deletes files. Reconcile only reads from disk.
  • Never deletes DB rows. Missing assets are flipped from downloaded to failed, not purged. The row keeps its metadata, checksum, and history.
  • --dry-run is a read-only preview. Reports the count of would-flip assets; writes nothing.

Flags

Flag Description
--dry-run Preview the count without updating the state DB

Common runtime flags such as --config, --log-level, --friendly, and --no-friendly apply to this command.

Periodic reconcile in watch mode

Watch-mode users can run reconcile on a schedule with [watch].reconcile_every_n_cycles instead of invoking the command by hand. Off by default. Pair it with [watch].interval for things like hourly sync plus daily reconcile.

Related

Commands

Getting Started

Features

Clone this wiki locally