---
name: "mdm-sync"
section: "1"
platform: "linux"
package: "mdm"
version: "0.1.3-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mdm-run"
---

# mdm-sync(1)

run a command in parallel with mdm-master

Part of [mdm-run(1)](/mdm-run/1.md).

## NAME

mdm-run - run a command in parallel with mdm-master

## SYNOPSIS

**mdm-run** *command*\
 **mdm-sync** *command*

## DESCRIPTION

**mdm-run** annotates *command* as a candidate for parallel execution. If an **mdm-master** process is present (i.e., the environment variable **MDM\_CMD\_SOCK** is defined), **mdm-run** submits *command* to the **mdm-master**, and it exits when the master issues the *command* to an **mdm-slave** process (which may be connected to another terminal) for execution. **mdm-sync** runs *command* in place, but it coordinates with **mdm-master** to ensure that executing *command* does not interfere with commands that are currently executing in parallel.

If there is no **mdm-master** process present (i.e., the environment variable **MDM\_CMD\_SOCK** is not defined), both **mdm-run** and **mdm-sync** simply run *command* as if you entered *command* all by itself.

These programs are a part of the Middleman System (mdm).

## OPTIONS

Neither **mdm-run** nor **mdm-sync** accepts any options.

## EXIT STATUS

If there is no **mdm-master** process present, the exit status of **mdm-run** is the exit status of *command*. If an **mdm-master** process is present, the exit status is 0 if and only if *command* is successfully issued to an **mdm-slave** process for execution.

The exit status of **mdm-sync** is always the exit status of *command*.

## ENVIRONMENT

The mdm system uses the following environment variable for internal communication, and thus you should not try to set them yourself.

- MDM\_CMD\_SOCK

  **mdm-run** uses this environment variable to decide whether a **mdm-master** process is present.

## EXAMPLE

See [**mdm.screen**(1)](/mdm.screen/1.md) for an example use of **mdm-run**.

## SEE ALSO

[**mdm.screen**(1)](/mdm.screen/1.md)
