REPEATCMD(1)

NAME
repeatcmd - repeatedly run a command

SYNOPSIS
repeatcmd [--wait SECS] [--until-failure] [--max-tries N] [--max-time DURATION] [--] COMMAND ARG...

DESCRIPTION
repeatcmd executes COMMAND with the given ARG arguments repeatedly until the command succeeds (exit code 0).

OPTIONS

--wait=SECS
    Wait SECS seconds between running the command. SECS is an integer.

--until-failure
    Repeat until the command fails (non-zero exit code).

--max-tries=N
    Repeat command at most N times until it succeeds or fails.

--max-time=DURATION
    Repeat command for at most DURATION time. The duration can be expressed with a suffix (s, m, h, and more).

-h, --help
    Print help.

--version
    Print version.

--  Stop processing options for repeatcmd and pass the rest of the arguments as-is to the command.

EXAMPLES
Wait for a server to be accessible via SSH (the --wait option avoids excessively fast repetition):

    repeatcmd --wait 1 ssh root@stamina

Wait for server to shut down:

    repeatcmd --wait 1 --until-failure -- ping -c1 example.com

The -B -- argument tells repeatcmd to not interpret the -c1 argument and to pass it to ping. Add the --max-time option to avoid waiting forever.

SEE ALSO
Full list of suffixes for DURATION. (https://docs.rs/duration-str/latest/duration_str/)