Giter Club home page Giter Club logo

retry's Introduction

retry

๐Ÿš retry shell commands

Examples

$ retry sh -c 'exit "$(($RANDOM % 3))"'
2016/08/27 19:41:11 run 1: command finished with error: exit status 1
2016/08/27 19:41:12 run 2: command finished with error: exit status 2
2016/08/27 19:41:13 run 3: command finished with error: exit status 2
2016/08/27 19:41:14 run 4: command finished with error: exit status 2
2016/08/27 19:41:15 run 5: command finished with error: exit status 2
2016/08/27 19:41:16 run 6: command finished with error: exit status 1
2016/08/27 19:41:17 Command succeeded on attempt 7 with a total duration of 6 seconds
$
$ retry -q sh -c 'exit "$(($RANDOM % 3))"'
$
$ retry false
2016/08/27 19:38:25 run 1: command finished with error: exit status 1
2016/08/27 19:38:26 run 2: command finished with error: exit status 1
2016/08/27 19:38:27 run 3: command finished with error: exit status 1
2016/08/27 19:38:28 run 4: command finished with error: exit status 1
2016/08/27 19:38:29 run 5: command finished with error: exit status 1
^C
$
$ retry true
2016/08/27 19:38:10 Command succeeded on attempt 1 with a total duration of 0 second
$

Usage

$ retry -h
NAME:
   retry - retry

USAGE:
   retry [global options] command [command options] [arguments...]

VERSION:
   0.4.0

AUTHOR(S):
   Manfred Touron <https://moul.io/retry>

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --interval value, -n value      seconds to wait between attempts (default: 1) [$RETRY_INTERVAL]
   --quiet, -q                     don't print errors [$RETRY_QUIET]
   --clear, -c                     clear screen between each attempts [$RETRY_CLEAR]
   --timeout value, -t value       maximum seconds per attempt (disabled=0) (default: 0) [$RETRY_TIMEOUT]
   --max-attempts value, -m value  quit after NUM attempts (default: 0) [$RETRY_MAX_ATTEMPTS]
   --reverse-behavior, -r          inverse behavior, stop on first fail [$RETRY_REVERSE_BEHAVIOR]
   --help, -h                      show help
   --version, -v                   print the version

Install

With Golang

  1. Install and configure Golang
  2. go get moul.io/retry

With Homebrew

brew install moul/moul/retry

License

MIT

retry's People

Contributors

dependabot[bot] avatar dzalevski avatar moul avatar moul-bot avatar renovate-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.