Crates.io | retry-cli |
lib.rs | retry-cli |
version | 0.0.5 |
source | src |
created_at | 2020-04-17 17:01:09.124188 |
updated_at | 2024-08-23 15:37:17.13611 |
description | retry commands with automatic backoff |
homepage | |
repository | https://github.com/demoray/retry-cli |
max_upload_size | |
id | 231241 |
size | 10,228 |
A small command line application that assists in retrying failed commands.
retry
is a command line tool written in Rust intended to automatically re-run failed commands with a user configurable delay between tries.
Usage: retry [OPTIONS] <COMMAND>...
Arguments:
<COMMAND>...
Options:
--attempts <ATTEMPTS>
[default: 3]
--min-duration <MIN_DURATION>
minimum duration
Examples: `10ms`, `2s`, `5m 30s`, or `1h10m`
[default: 10ms]
--max-duration <MAX_DURATION>
maximum duration
Examples: `10ms`, `2s`, `5m 30s`, or `1h10m`
--jitter <JITTER>
amount of randomization to add to the backoff
[default: 0.3]
--factor <FACTOR>
backoff factor
[default: 2]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
$ cargo install retry-cli
Working successfully:
$ retry echo hi
hi
$
The command fails to execute
$ retry cmd-does-not-exist
Error: "unable to execute: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }"
$
The command executes, but fails
$ retry false
failed, retrying...
failed, retrying...
Error: "continued to fail after 3 attempts"
$