Crates.io | retry-cli |
lib.rs | retry-cli |
version | 0.0.2 |
source | src |
created_at | 2020-04-17 17:01:09.124188 |
updated_at | 2024-05-07 19:34:12.43433 |
description | retry commands with automatic backoff |
homepage | |
repository | https://github.com/demoray/retry-cli |
max_upload_size | |
id | 231241 |
size | 16,951 |
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.
retry 0.0.1
Brian Caswell <bmc@shmoo.com>
retry commands with automatic backoff
USAGE:
retry [OPTIONS] [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--duration <duration> duration (specified in tenths of a second) [default: 10]
--method <method> retry methods [default: Fibonacci] [possible values: Fibonacci, Fixed, NoDelay]
--retries <retries> specify maximum number of times to retry [default: 3]
$ cargo install retry-cli
Working successfully:
$ retry echo hi
hi
$
The command fails with a signal
$ retry cmd-does-not-exist
retry failed: unable to execute: Os { code: 2, kind: NotFound, message: "No such file or directory" }
$
With a duration of a half second between tries, increasing following a Fibonacci sequence (default delay method)
$ time retry --duration 50 false
failed, retrying...
failed, retrying...
failed, retrying...
retry failed: continued to fail after 3 retries
real 0m15.009s
user 0m0.008s
sys 0m0.000s
$
With a fixed duration of a half second between tries
$ time retry --method fixed --duration 50 false
failed, retrying...
failed, retrying...
failed, retrying...
retry failed: continued to fail after 3 retries
real 0m5.016s
user 0m0.012s
sys 0m0.004s
$
With no delay at all
$ time retry --method nodelay false
failed, retrying...
failed, retrying...
failed, retrying...
retry failed: continued to fail after 3 retries
real 0m0.007s
user 0m0.006s
sys 0m0.000s
$
Retrying 5 times
$ retry --retries 5 false
failed, retrying...
failed, retrying...
failed, retrying...
failed, retrying...
failed, retrying...
retry failed: continued to fail after 5 retries
$