Skip to content

apply

Execute the plan with journaled, idempotent, same-volume renames.

media-ingest apply [OPTIONS]

apply is the only command that moves your media. It reads .ingest/plan.json and performs each rename, guarding every move and recording it to a journal so the whole operation can be undone or safely resumed. See the safety model for the full set of guarantees.

Options

  • --yes skips the confirmation prompt. Without it, apply asks before renaming anything.
  • --root points at a specific project directory.

Example

media-ingest apply
Rename 1789 files under /Volumes/T7/PROJECTS/2026-03_my-trip? [y/N]: y
moved: 1789   already done: 0   errors: 0
Journal: /Volumes/T7/PROJECTS/2026-03_my-trip/.ingest/apply-log.jsonl   (undo with 'media-ingest undo')

What each move guarantees

For every file in the plan, apply:

  • re-hashes the source immediately before moving it, and aborts that single move if the content no longer matches the hash recorded at scan time (the file changed since you scanned),
  • refuses to overwrite: if the destination already exists with different content, that move is an error,
  • only renames within the project volume, and errors out if the source is on a different volume than the project root,
  • appends the completed move to .ingest/apply-log.jsonl before starting the next one.

Errored files are left exactly where they are. apply reports how many moved, how many were already done, and how many errored, then lists the errors. If any move errored, apply exits with a non-zero status.

Idempotent re-runs

apply is safe to run again. If a file has already been moved to its destination (the source is gone and the destination is present with the matching hash), that move is counted as "already done" rather than repeated or errored. So if a run is interrupted partway through, by a full disk, an unplugged drive, or a Ctrl-C, you can just fix the problem and run media-ingest apply again to finish. You do not need to undo first.

Undoing

Every move apply makes is recorded, so undo can reverse the entire operation. Because apply is idempotent, undo is for changing your mind, not for recovering from an interruption.

Next

Check the results, and if the layout is not what you wanted, run undo to restore original paths.