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

# rancid-run(1)

run rancid for each of the groups

## NAME

rancid-run - run rancid for each of the groups

## SYNOPSIS

**rancid-run** \[**-V**\] \[**-c**  commit\_msg\] \[**-f**  rancid.conf\] \[**-m**  mail\_rcpt\] \[**-r**  device\_name\] \[group \[group ...\]\]

## DESCRIPTION

**rancid-run** is a [*sh*(1)](/sh/1.md) script to run [*rancid*(1)](/rancid/1.md) for a set of rancid group(s).

**rancid-run** reads [**rancid.conf**(5)](/rancid.conf/5.md) to configure itself, then uses [*control\_rancid*(1)](/control_rancid/1.md) to run [*rancid*(1)](/rancid/1.md) for each rancid group.  The set of rancid groups can either be provided as command-line arguments or via the *LIST\_OF\_GROUPS* variable in [**rancid.conf**(5)](/rancid.conf/5.md), if the group argument is omitted.

A lock file is maintained per-group to prevent simultaneous runs for a given group by [*rancid-run*(1)](/rancid-run/1.md). The lock file will be named *.\<group\>.run.lock* and will be located in */var/lib/rancid*.

A log file is produced under *$LOGDIR/logs* for each rancid group processed.  The file name will be \<group\>.YYYYMMDD.HHMMSS (year month day . hour minute second).

**rancid-run** is normally used to run rancid from [**cron**(8)](/cron/8.md). For example:

```
0 * * * *      /usr/local/rancid/bin/rancid-run
```

The command-line options are as follows:

- **-V**

  Prints package name and version strings.

- **-c commit\_msg**

  Specify an alternative SCM commit message.

- **-f rancid.conf**

  Specify an alternate configuration file.

- **-m mail\_rcpt**

  Specify the recipient of diff mail, which is normally rancid-\<group\>.  The argument may be a single address, multiple comma separated addresses, or **-m** may be specified multiple times.

- **-r device\_name**

  Run rancid for a single device, *device\_name*. *device\_name* should be name, as it appears in a group's router.db.  The device must be marked "up".  If a group is not specified on the command-line, rancid will be run against any group in which the device\_name appears.

  The  **-r** option alters the subject line of the diff mail.  It will begin with \<group name\>/\<device name\> rather than just the group name alone.

## ENVIRONMENT

**rancid-run** utilizes the following environment variables from [**rancid.conf**(5)](/rancid.conf/5.md).

- **BASEDIR**

  Location of group directories, etc.  This is set to the "localstatedir" by the configure script at installation time.

- **LIST\_OF\_GROUPS**

  List of rancid groups to collect.

- **PATH**

  Search path for utilities.

- **TMPDIR**

  Directory to hold temporary files.

## ERRORS

If rancid fails to run or collect a device's configuration, the particular group's log file (mentioned above) should be consulted.  Any errors produced by the revision control system (CVS, Subversion, or git) or any of the rancid scripts should be included there, whether they be a botched cvs tree, login authentication failure, rancid configuration error, etc. If the log file produces no clues, the next debugging step should be run the commands manually.  For example, can the user who runs rancid login to the device with 'clogin hostname', and so on.

## FILES

- **$BASEDIR/etc/rancid.conf**

  **rancid-run** configuration file.

## SEE ALSO

[**control\_rancid**(1)](/control_rancid/1.md), [**rancid.conf**(5)](/rancid.conf/5.md), [**router.db**(5)](/router.db/5.md)

## CAVEATS

DO NOT leave temporary files in the \<group name\>/configs directory, they WILL be removed by [**control\_rancid**(1)](/control_rancid/1.md). The subdirectory \<group name\>/configs/.old can used for this purpose.
