Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep directory structure with aria2?

Tags:

linux

unix

aria2

I need to download files simultaneously- wget doesn't support that so I want to try aria2. But I don't see an option in aria2 to keep directory structure.

like image 869
Tom Avatar asked Feb 12 '23 01:02

Tom


1 Answers

Determine the directory structure first, then build and use a download description file:

aria2c -i uri.txt

where uri.txt might contain

http://serverA/file1.iso http://mirror-serverB/file1.iso
# parameters must begin with a space, otherwise it's treatened as url!
 dir=/downloads/a
# not mandatory
 out=file1.iso

http://serverA/file2.iso http://mirror-serverB/file2.iso
 dir=/downloads/b
 out=file2.iso

Keep in mind that aria2 is a download util - not an sync util, like rsync or lftp.

Referencing an rsync answer: https://stackoverflow.com/a/4147263/1163786 and an lftp answer: https://superuser.com/a/305236.

like image 130
Jens A. Koch Avatar answered Feb 13 '23 15:02

Jens A. Koch