Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/preethamvishy/try

A command line tool to try executing a shell command and retry if it fails. Optionally repeat with time intervals even if it succeeds. 🔁 https://www.npmjs.com/package/try-cli
https://github.com/preethamvishy/try

bash bash-script cli command command-line command-line-tool commandline commandline-interface node nodejs npm repeat repeater repeats retry zsh zshell zshrc

Last synced: 4 months ago
JSON representation

A command line tool to try executing a shell command and retry if it fails. Optionally repeat with time intervals even if it succeeds. 🔁 https://www.npmjs.com/package/try-cli

Awesome Lists containing this project

README

        

# try 🚀

`try` is a command line utility to try executing a shell command and retry if it fails. Optionally, you can let it repeat even if it succeeds.

![try](https://i.imgur.com/2KEWGvK.png)

You run a long running command and leave to grab a ☕️, hoping to come back to a completed execution but you come back to find that the process failed due to a connectivity issue which is now fixed 🎩. You are now left to re-run the process and spend several caffeine-powered minutes staring at your terminal. Never again!

## Usage

Use the `try` keyword.

### Flags

```bash
-a, --attempts => Maximum number of retry attempts.

-t, --timeout => Seconds between retries.

-c, --command => Command to try

-f, --force-repeat => Force repeated execution even if it succeeds'

```

### Examples

`try -c ls -t 5 -a 5 -f`

`try --command ls --timeout 5 --attempts 5 --force-repeat`

`try -c 'ls -la' --timeout 5`

`try -c "ls -la" --attempts 5`

Note that multi-word commands or commands with flags must be enclosed in single or double quotes (' ' or " ").

##### Made with ❤️.