Skip to content

Reconcile

rhoopr edited this page Apr 21, 2026 · 5 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 -u my@email.address --dry-run

# Apply: flip every missing file's row to status=failed
kei reconcile -u my@email.address

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

Global flags (--username, --config, --data-dir, --domain, --log-level) apply to this command.

Related

Clone this wiki locally