-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Aria2 seems to only save a control file on a graceful exit or (by default) every 60 seconds. There doesn't appear to be a way to force a save, and will always wait at least 60 seconds after starting (or whatever is configured) before it saves the initial file.
It may be ideal, in some situations, if a blank control file could be immediately saved when the download is started. Ideally, this control file should be written before the file to-be-downloaded is preallocated on disk.
This can be useful in some automation cases, for example, automatically resuming after a crash occurs. With the current behavior, if a download starts but a crash or unexpected shutdown happens within 60 seconds (i.e. before it can write the control file), attempting to resume downloads will fail as the destination file already exists. This can be worked around via --allow-overwrite
but this isn't ideal if you actually want the process to fail if the file originally existed. If a blank control file exists, aria2 can see that it needs to resume this download (although resume from the beginning) rather than fail due to a file existing.
A possible alternative may be to allow incomplete downloads to be named differently (#284), where, if it encounters such a file, it can be "resumed" (again, from the beginning) if no corresponding control file exists.
Thanks for the awesome tool and hope it makes sense :)
(and apologies if something already exists to do this that I missed (I'm actually running an older version of aria2, and haven't checked whether the latest version acts differently))