What Happens When Wget Quota Is Exceeded?

This article provides a quick overview of how the GNU wget utility behaves when a pre-configured download quota is exceeded. When using the --quota limit, wget monitors the cumulative size of downloaded files during a single execution or session. Once this threshold is crossed, the utility immediately terminates any further downloading to prevent excessive bandwidth or storage consumption, though its behavior varies slightly depending on whether it is downloading a single file or a list of files.

Understanding the Wget Quota Mechanism

The --quota option in wget allows users to specify a maximum byte limit for downloads, using suffixes like k for kilobytes and m for megabytes. It is important to note that this quota is not enforced by the remote server, but is a client-side restriction managed entirely by wget itself.

Behavior During Single vs. Multiple File Downloads

The exact behavior of wget depends on the context of the download queue:

Example Scenario

If you attempt to download a list of files with a set quota, the execution follows a strict sequential check:

  1. You run wget --quota=10m -i download_list.txt.
  2. The first file is 8 MB. It downloads completely. Total downloaded: 8 MB (under quota).
  3. The second file is 5 MB. wget starts downloading it because the quota was not yet exceeded when the download began.
  4. The second file completes. Total downloaded is now 13 MB.
  5. wget checks the quota, realizes 13 MB exceeds the 10 MB limit, and exits. The remaining files in download_list.txt are ignored.