Skip to main content

It is a Python library that allows you to retry executing a command multiple times until it succeeds or reaches the maximum number of retries. It provides options to customize the behavior of retries, such as setting a timeout for each execution and specifying the return codes that indicate success.

Project description

Retry Command

Introduction

Retry Command is a Python library that allows you to retry executing a command multiple times until it succeeds or reaches the maximum number of retries. It provides options to customize the behavior of retries, such as setting a timeout for each execution and specifying the return codes that indicate success.

Installation

To use Retry Command, you need to have Python installed on your system. You can install the library using pip:

pip install retryCommand

Usage

Retry Command can only be used as a standalone script

Standalone Script

To use Retry Command as a standalone script, you can run the following command:

do-retry [options] -c <command>

Replace <command> with the command you want to execute. You can also specify various options to customize the behavior of retries. Use the -h or --help option to see the available options and their descriptions.

Options

Retry Command provides several options to customize the behavior of retries:

  • -s, --no-stop-after-success: Do not stop retrying after the command succeeds.
  • -p, --no-ignore-process-error: Do not stop retrying after encountering a process error.
  • -m, --max-num-of-retry: Maximum number of retries. Set to -1 for unlimited retries.
  • -i, --interval: Interval between retries in seconds.
  • -t, --time-out: Timeout for each execution in seconds. Set to -1 for no timeout.
  • -d, --cwd: Current working directory for the command.
  • -n, --success-return-code: Return codes that indicate success. Multiple values can be specified.
  • -q --quite: mute more output.
  • --mute: mute all output.
  • -l, --no-need-to-log: Does not output any records outside of stdou. It only works when mute is on.
  • -c, --command: Command to execute.

Examples

Here are some examples of how to use Retry Command:

  • Retry executing a command until it succeeds, ignoring process errors:
do-retry -c <command>
  • Retry executing a command with a maximum of 3 retries, an interval of 2 seconds, and a timeout of 5 seconds:
do-retry -m 3 -i 2 -t 5 -c <command>

License

Retry Command is licensed under the MulanPSL-2.0 License. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retryCommand-0.0.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

retryCommand-0.0.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file retryCommand-0.0.2.tar.gz.

File metadata

  • Download URL: retryCommand-0.0.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for retryCommand-0.0.2.tar.gz
Algorithm Hash digest
SHA256 60ee61028334f23ab05f71de83c496ae6047ac884ebb205af49639d233e95527
MD5 2e6913ff0971f086334f47e66b13eecc
BLAKE2b-256 09768d698cc80ab18cd8b150394d69be60b721ea4ecb93f4b9e35c1328bd92ba

See more details on using hashes here.

File details

Details for the file retryCommand-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: retryCommand-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for retryCommand-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 323636f6332efae442517cd0dc8325bfc82cf958044bbe4522f7bf830e9a9307
MD5 b784ea9a4f74fd86b7979661d09b1ef7
BLAKE2b-256 9cdb1b1ba1a648963f9cd690a578c72d87bf60a9982c174bb50e59890de433d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page