Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1retry - The command line retry tool2------------------------------------------4Retry any shell command with exponential backoff or constant delay.6### Instructions8Install:10retry is a shell script, so drop it somewhere and make sure it's added to your $PATH. Or you can use the following one-liner:12```sh13sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"14```16If you're on OS X, retry is also on Homebrew:18```19brew pull 2728320brew install retry21```22Not popular enough for homebrew-core. Please star this project to help.24### Usage26Help:28`retry -?`30Usage: retry [options] -- execute command31-h, -?, --help32-v, --verbose Verbose output33-t, --tries=# Set max retries: Default 1034-s, --sleep=secs Constant sleep amount (seconds)35-m, --min=secs Exponential Backoff: minimum sleep amount (seconds): Default 0.336-x, --max=secs Exponential Backoff: maximum sleep amount (seconds): Default 6037-f, --fail="script +cmds" Fail Script: run in case of final failure39### Examples41No problem:43`retry echo u work good`45u work good47Test functionality:49`retry 'echo "y u no work"; false'`51y u no work52Before retry #1: sleeping 0.3 seconds53y u no work54Before retry #2: sleeping 0.6 seconds55y u no work56Before retry #3: sleeping 1.2 seconds57y u no work58Before retry #4: sleeping 2.4 seconds59y u no work60Before retry #5: sleeping 4.8 seconds61y u no work62Before retry #6: sleeping 9.6 seconds63y u no work64Before retry #7: sleeping 19.2 seconds65y u no work66Before retry #8: sleeping 38.4 seconds67y u no work68Before retry #9: sleeping 60.0 seconds69y u no work70Before retry #10: sleeping 60.0 seconds71y u no work72etc..74Limit retries:76`retry -t 4 'echo "y u no work"; false'`78y u no work79Before retry #1: sleeping 0.3 seconds80y u no work81Before retry #2: sleeping 0.6 seconds82y u no work83Before retry #3: sleeping 1.2 seconds84y u no work85Before retry #4: sleeping 2.4 seconds86y u no work87Retries exhausted89Bad command:91`retry poop`93bash: poop: command not found95Fail command:97`retry -t 3 -f 'echo "oh poopsickles"' 'echo "y u no work"; false'`99y u no work100Before retry #1: sleeping 0.3 seconds101y u no work102Before retry #2: sleeping 0.6 seconds103y u no work104Before retry #3: sleeping 1.2 seconds105y u no work106Retries exhausted, running fail script107oh poopsickles109Last attempt passed:111`retry -t 3 -- 'if [ $RETRY_ATTEMPT -eq 3 ]; then echo Passed at attempt $RETRY_ATTEMPT; true; else echo Failed at attempt $RETRY_ATTEMPT; false; fi;'`113Failed at attempt 0114Before retry #1: sleeping 0.3 seconds115Failed at attempt 1116Before retry #2: sleeping 0.6 seconds117Failed at attempt 2118Before retry #3: sleeping 1.2 seconds119Passed at attempt 3121### License123Apache 2.0 - go nuts
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.