Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/preethamvishy/try
- Owner: preethamvishy
- License: mit
- Created: 2018-03-30T18:37:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T06:45:20.000Z (over 4 years ago)
- Last Synced: 2024-09-29T08:20:57.735Z (4 months ago)
- Topics: bash, bash-script, cli, command, command-line, command-line-tool, commandline, commandline-interface, node, nodejs, npm, repeat, repeater, repeats, retry, zsh, zshell, zshrc
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 ❤️.