Config aria2 to drop download if resume unsupported?
This article provides a direct solution for configuring the
aria2 command-line download utility to automatically abort
a download if the remote server does not support resuming. By default,
aria2 will restart a download from scratch if a connection
drops and the server lacks resume capabilities, which can waste
significant time and bandwidth. Below, you will find the specific
configuration flags required to change this behavior, along with
examples for both the command line and configuration files.
The aria2c
Configuration Flags
To force aria2 to drop a download when resume is
unsupported, you need to combine two specific command-line options:
--conditional-get and --allow-overwrite.
--conditional-get=true: This tellsaria2to check if the remote file has been modified or if the server supports the features required to resume. If the server does not support the necessary headers (likeETagorLast-Modified) to validate and resume the transfer safely,aria2will handle the download based on your overwrite settings.--allow-overwrite=false: When set to false, this preventsaria2from simply deleting your existing partial download and starting over from 0% when a resume fails. Instead, it will throw an error and terminate the process.
Command Line Implementation
When starting a download from the terminal, you can append these flags directly to your command:
aria2c --conditional-get=true --allow-overwrite=false "https://example.com/largefile.zip"If the server at example.com does not support resuming,
aria2 will stop immediately instead of wiping your progress
and restarting the download from the beginning.
Persistent Configuration File Setup
If you prefer not to type these flags every time, you can add them to
your global aria2 configuration file (typically located at
~/.config/aria2/aria2.conf on Linux/macOS or in the same
directory as the executable on Windows).
Open your aria2.conf file and add the following
lines:
# Abort download if resume is not supported by the server
conditional-get=true
allow-overwrite=false
Once saved, aria2 will apply this logic to all future
download tasks automatically, safeguarding your bandwidth against
unresumable connections.