Adjusting aria2c download options

Adjusting aria2c download options

Postby hbuhrmester » 19.06.2015, 09:48

With its default options, aria2c likes to screw up downloads of the virus definition files even more than wget. Sometimes it requests file segments from the server, which don't even exist, and then it completely fails. At least it returns some appropriate error code, and then the script DownloadUpdates.cmd stops with a Download Error message.

But it seems possible, to prevent such errors by carefully adjusting aria2c's download options. To prevent corrupted files, the downloader should not just resume the download after network failures, but always restart from scratch. aria2c may do that with the command line options:

Code: Select all
--always-resume=false --max-resume-failure-tries=0 --max-tries=10 --retry-wait=10 --timeout=60


Also, the timestamping feature may work best, if the changed date of the local file is set to the timestamp of the remote file on the server. wget always does this, but aria2c needs another option:

Code: Select all
--remote-time=true


If you used the script wsusoffline\cmd\ActivateAria2Downloads.cmd, you may find a file wsusoffline\cmd\custom\SetAria2EnvVars.cmd. Then add the above options to the line:

Code: Select all
DLDR_COPT=--conditional-get=true --allow-overwrite=true --file-allocation=none -x10 -j10 -s10 -k1M -R


I also noticed, that aria2c does not create the download directory itself; the directory must always be created by the calling script. But the script wsusoffline\cmd\DownloadUpdates.cmd does not seem to do that. Each download section starts with:

Code: Select all
if not exist ..\client\wddefs\nul goto DownloadWDDefs


and then it goes on with:

Code: Select all
:DownloadWDDefs
echo Downloading/validating Windows Defender definition files...
%DLDR_PATH% %DLDR_COPT% %DLDR_IOPT% ..\static\StaticDownloadLink-wddefs-%TARGET_ARCH%-glb.txt %DLDR_POPT% ..\client\wddefs\%TARGET_ARCH%-glb
if errorlevel 1 goto DownloadError


This may not be enough for aria2c. The structure of the client directory, using German and English as languages for Windows 2003 Server and Office, should be:

Code: Select all
client
client\bin
client\cmd
client\cmd\custom
client\cpp
client\dotnet
client\dotnet\x64-glb
client\dotnet\x86-glb
client\exclude
client\exclude\custom
client\md
client\msse
client\msse\x64-glb
client\msse\x86-glb
client\o2k10
client\o2k10\deu
client\o2k10\enu
client\o2k10\glb
client\o2k13
client\o2k13\deu
client\o2k13\enu
client\o2k13\glb
client\o2k7
client\o2k7\deu
client\o2k7\enu
client\o2k7\glb
client\ofc
client\ofc\deu
client\ofc\enu
client\ofc\glb
client\opt
client\software
client\software\custom
client\software\msi
client\static
client\static\custom
client\w2k3
client\w2k3\deu
client\w2k3\enu
client\w2k3\glb
client\w2k3-x64
client\w2k3-x64\deu
client\w2k3-x64\enu
client\w2k3-x64\glb
client\w60
client\w60\glb
client\w60-x64
client\w60-x64\glb
client\w61
client\w61\glb
client\w61-x64
client\w61-x64\glb
client\w62
client\w62\glb
client\w62-x64
client\w62-x64\glb
client\w63
client\w63\glb
client\w63-x64
client\w63-x64\glb
client\wddefs
client\wddefs\x64-glb
client\wddefs\x86-glb
client\win
client\win\glb
client\wle
client\wsus


Create these directories as needed.

wget, on the other hand, has some powerful recursive download options. It can be used to mirror complete websites, and then it creates the whole directory structure on its own.
hbuhrmester
 
Posts: 525
Joined: 11.10.2013, 20:59

Re: Adjusting aria2c download options

Postby WSUSUpdateAdmin » 24.06.2015, 08:00

Moin und danke schön! :)

Zumindest die Parameter-Ergänzungen hab' ich schon mal drin...

Gruß
Torsten
WSUSUpdateAdmin
Administrator
 
Posts: 2245
Joined: 07.07.2009, 14:38


Return to Download

Who is online

Users browsing this forum: No registered users and 408 guests