Skip to content

Dry run

A dry run is an execution of a process that computes and reports what would happen without committing any side effects; the term comes from theatre rehearsals without costumes and from chemistry without solvent.

Definition

What it is

A dry run is a rehearsal with the tooling of the real thing. It runs the same code path, reads the same inputs, computes the same plan, and prints it. What it does not do is commit. rsync --dry-run lists the files it would transfer. git commit --dry-run reports the commit it would create. terraform plan computes the diff it would apply. make -n prints the commands it would run.

The value is diagnostic. A dry run answers the question "what would change?" before the change becomes irreversible. In production, that answer is often worth more than the change itself.

Dry run vs --force vs preview

Aspect

Dry run

--force

Preview

Side effects

None

All

Depends

Reversibility

Instant

Depends on backup

Instant

Typical flag

--dry-run, -n, plan

--force, -f

URL param, mode toggle

Best for

Validating changes

Overriding guards

Showing rendered output

Fails safe?

Always

Rarely

Depends

Where dry runs happen

graph LR
  A["User requests change"] --> B["Tool computes plan"]
  B --> C{"--dry-run?"}
  C -->|Yes| D["Print plan, exit"]
  C -->|No| E["Commit side effects"]
  D --> F["User reviews"]
  F --> A
  E --> G["Change visible"]
  style D fill:#FFF3E0
  style G fill:#E8F5E9

Common dry-run flags

  1. rsync --dry-run / -n — lists files that would be transferred.

  2. git commit --dry-run — shows what would be committed.

  3. make -n — prints commands without executing them.

  4. terraform plan — computes the diff before apply.

  5. ansible-playbook --check — runs playbook without making changes.

  6. docker compose --dry-run (experimental) — prints the config that would be applied.

  7. mkdir --dry-run — GNU coreutils 8.x added the flag for consistency.

How to use one well

A dry run that actually catches mistakes

  1. Read the plan, do not skim

    A plan with three changes is easy to review. A plan with three thousand changes needs a second opinion.

  2. Compare against expectations

    If you expected one file deleted and the plan says fifteen, stop.

  3. Dry-run against production

    Staging has different data. A dry run against the real target catches the surprises that staging hides.

  4. Log the dry run

    Save the plan output. It becomes the contract for what the real run should produce.

Origin

In theatre, a dry run (or dry tech) is a rehearsal without costumes, without full makeup, without the full set. The actors run their lines and their blocking, but the expensive parts of the production are not yet in play. The purpose is to check timing and staging before the dress rehearsal, where the real thing happens with all the consequences.

In chemistry, a dry run is an experiment run without the solvent that will be used in the real reaction, to test a procedure's steps. The metaphor crossed to engineering, where a dry run means a test execution with the expensive or irreversible parts disabled.

Software adopted it in the 1970s with make -n, formalized it in the 1980s and 1990s with rsync --dry-run and similar flags, and made it central to modern infrastructure-as-code: terraform plan is a dry run made into a product feature.

A dry run is a rehearsal of a process that shows what the process would do if you let it happen, without letting it happen.

— Adapted from rsync documentation, 1996
1976 · `make -n` formaliza el dry run en build tools
1996 · `rsync --dry-run` populariza el flag
2009 · `git commit --dry-run` en git 1.6.5
2014 · `terraform plan` como producto
3 s · tiempo típico de un `plan` en infraestructura media

Evidence

FAQ

When should I dry-run?

Before any change that is expensive to undo: mass edits, migrations, deploys, infrastructure changes, DNS updates.

Why does the plan disagree with the real run?

State drift: the tool's view of the world is stale. Refresh state, then dry-run again.

What if the tool has no dry-run flag?

Emulate it: read the docs, back up first, or run against staging. A missing flag is not an excuse.

Is dry-run the same as --check?

Semantically yes; different tools use different names. Ansible uses --check, rsync uses --dry-run, terraform uses plan.

Connections

Etymology

Origin: metaphor

  • dry (adjective): without liquid; figuratively, without the full conditions
  • run (noun): a continuous sequence of operation

Semantic network

Dry runoperationssoftware-sIdempotentRollbackCanaryDeployTerraform

● broader ● narrower ● related

Broader

  • operations
  • software-safety

Related

Sources