xref: /curl/docs/cmdline-opts/retry.md (revision 2494b8dd)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: retry
5Arg: <num>
6Added: 7.12.3
7Help: Retry request if transient problems occur
8Category: curl
9Multi: single
10See-also:
11  - retry-max-time
12Example:
13  - --retry 7 $URL
14---
15
16# `--retry`
17
18If a transient error is returned when curl tries to perform a transfer, it
19retries this number of times before giving up. Setting the number to 0
20makes curl do no retries (which is the default). Transient error means either:
21a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504
22response code.
23
24When curl is about to retry a transfer, it first waits one second and then for
25all forthcoming retries it doubles the waiting time until it reaches 10
26minutes which then remains delay between the rest of the retries. By using
27--retry-delay you disable this exponential backoff algorithm. See also
28--retry-max-time to limit the total time allowed for retries.
29
30curl complies with the Retry-After: response header if one was present to know
31when to issue the next retry (added in 7.66.0).
32