![Forrest logo](/images/logo.png)
retry
Retry is a command line tool designed to automate the process of retrying failed commands. It is particularly useful in scenarios where a command might fail due to temporary network issues, server outages, or other intermittent problems. The main purpose of Retry is to save time and effort by automatically retrying a failed command until it succeeds or reaches a maximum number of retries.
Some key features of Retry include customizable retry intervals, maximum retry attempts, exponential backoff strategy, and customizable error codes to indicate success or failure. Retry also allows specifying a timeout for each retry attempt, ensuring commands do not run indefinitely. Additionally, Retry provides a command history log, which can be helpful for debugging and tracking the success or failure of previous commands.
The tool is written in Python and can be installed via pip. It can be used with any command-line tool or script by simply prefixing the desired command with the word "retry". Retry supports various operating systems, including Linux, macOS, and Windows.
By automating the retry process, Retry simplifies error handling and allows for more robust and reliable command execution. It reduces the need for manual intervention when dealing with flaky commands or situations where retries are necessary to achieve success. Retry is highly flexible and configurable, making it suitable for a wide range of use cases where command execution may require multiple attempts.
List of commands for retry:
-
retry:tldr:1b4c7 retry: Retry a command until it succeeds.$ retry ${command}try on your machineexplain this command
-
retry:tldr:b311e retry: Retry a command every n seconds until it succeeds.$ retry --delay=${n} ${command}try on your machineexplain this command
-
retry:tldr:e0bb0 retry: Give up after n attempts.$ retry --times=${n} ${command}try on your machineexplain this command