Bird
0
0

You want to download a file but keep retrying on failure. Which command fixes this error in your script?

medium📝 Debug Q6 of 15
Linux CLI - Networking Commands
You want to download a file but keep retrying on failure. Which command fixes this error in your script?
wget --tries=3 http://example.com/file.zip
The script stops after 1 failure. Why?
AThe URL redirects and wget needs --max-redirect option
BThe network is down; wget stops immediately
CThe file exists locally; use -c to continue
DThe server blocks retries; use --retry-connrefused
Step-by-Step Solution
Solution:
  1. Step 1: Understand --tries behavior

    By default, wget retries on failures but not on connection refused errors.
  2. Step 2: Identify option to retry on connection refused

    The --retry-connrefused option enables retries even if connection is refused.
  3. Final Answer:

    The server blocks retries; use --retry-connrefused -> Option D
  4. Quick Check:

    Use --retry-connrefused to retry refused connections [OK]
Quick Trick: Add --retry-connrefused to retry refused connections [OK]
Common Mistakes:
  • Confusing redirect with retry
  • Ignoring connection refused errors
  • Assuming network down stops retries

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes