Google Search Within opentiss.uk

2007-01-28

aria2

aria2是Linux平台下的一个命令行下载工具。其命令名称为aria2c
sf.net简介:
Yet another utility for downloading files. It has segmented downloading engine in its core, and downloads one file from multiple URLs much faster than ordinary web browsers. aria2 currently supports HTTP, FTP and BitTorrent.

使用说明


此工具支持将一个文件分成多个区块进行下载,支持常用的http、ftp协议,也支持P2P下载,具备断点续传功能。

安装


./configure
make
[make check]
make install

简单使用示例


  • 将一个文件分成若干个区块进行下载:

  •  aria2c -s 5 http://ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/Sources/OOo_SRC680_m201_source.tar.gz
    aria2c -s 5 --ftp-user=anonymous --ftp-passwd=anonymous ftp://ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/Sources/OOo_SRC680_m201_source.tar.gz

    其中,-s参数为分割当前下载文件为多少个区块,后面的5就是块数,注意一个文件最多可分割为5个区块;--ftp- user参数用于设置ftp下载的用户名,--ftp-passwd参数当然就是用于设置ftp下载的用户密码了。
  • 有时可能所需要下载的文件非常大,不能在很短的时间内下载完成,又不想让下载进程单独占用一个ssh连接(指从非本机登录的情况),我一开始采用的办法是让aria2作为一个后台进程进行下载。示例如下:

  •  aria2c -s 5 http://ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/Sources/OOo_SRC680_m201_source.tar.gz &

    参照命令行参考,也可以将aria2作为一个守护进程(daemon)来进行下载(效果基本上是一样的)。示例如下:
     aria2c -s 5 -D http://ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/Sources/OOo_SRC680_m201_source.tar.gz

    特别提示


    在下载的过程中会出现无法正常完成的情况,此时也不必担心,aria2会将下载日志写入本地目录的.aria2文件中,如果要重启相应的下载,只需将没有完成的下载命令再执行一次即可,下载将从刚才断开的位置继续进行下载。

    最后还有一个小问题,如果采用后台守护进程进行下载,怎么才能知道是否已经下载完成了呢?其实方法也比较简单,首先是看本地下载目录中是否存在相应的.aria2文件,如果存在,肯定是出现了网络连接问题,需要重启刚才的下载,进行断点续传;如果本地下载目录中不存在相应的.aria2文件,也不表示已经正常下载完成了;如果只启动了一个aria2进程下载这个文件,没有其他aria2进程在下载东西的话,可以直接看当前系统进程中是否还存在那个aria2进程,示例如下:
     ps xf | grep aria2c

    如果查询后发现那个aria2进程已经正常退出了,则可以确定文件下载已经成功完成;最后,如果还不确信是否已经成功下载,可以查看下载到本地的文件修改时间是否已经不再持续更新了,当然,如果提供该文件下载的网站也同时提供MD5或其他校验码,对下载后的文件进行一下校验即可。

    命令行参考



    # aria2c --help
    Usage: aria2c [options] URL ...
    aria2c [options] -T TORRENT_FILE FILE ...

    Options:
    -d, --dir=DIR The directory to store downloaded file.
    -o, --out=FILE The file name for downloaded file.
    -l, --log=LOG The file path to store log. If '-' is specified,
    log is written to stdout.
    -D, --daemon Run as daemon.
    -s, --split=N Download a file using N connections. N must be
    between 1 and 5. This option affects all URLs.
    Thus, aria2 connects to each URL with
    N connections.
    --retry-wait=SEC Set amount of time in second between requests
    for errors. Specify a value between 0 and 60.
    Default: 5
    -t, --timeout=SEC Set timeout in second. Default: 60
    -m, --max-tries=N Set number of tries. 0 means unlimited.
    Default: 5
    --http-proxy=HOST:PORT Use HTTP proxy server. This affects to all
    URLs.
    --http-user=USER Set HTTP user. This affects to all URLs.
    --http-passwd=PASSWD Set HTTP password. This affects to all URLs.
    --http-proxy-user=USER Set HTTP proxy user. This affects to all URLs
    --http-proxy-passwd=PASSWD Set HTTP proxy password. This affects to all URLs.
    --http-proxy-method=METHOD Set the method to use in proxy request.
    METHOD is either 'get' or 'tunnel'.
    Default: tunnel
    --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, basic
    is the only supported scheme.
    Default: basic
    --referer=REFERER Set Referer. This affects to all URLs.
    --ftp-user=USER Set FTP user. This affects to all URLs.
    Default: anonymous
    --ftp-passwd=PASSWD Set FTP password. This affects to all URLs.
    Default: ARIA2USER@
    --ftp-type=TYPE Set FTP transfer type. TYPE is either 'binary'
    or 'ascii'.
    Default: binary
    -p, --ftp-pasv Use passive mode in FTP.
    --ftp-via-http-proxy=METHOD Use HTTP proxy in FTP. METHOD is either 'get' or
    'tunnel'.
    Default: tunnel
    --lowest-speed-limit=SPEED Close connection if download speed is lower than
    or equal to this value(bytes per sec).
    0 means aria2 does not care lowest speed limit.
    You can append K or M(1K = 1024, 1M = 1024K).
    This option does not affect BitTorrent download.
    Default: 0
    --max-download-limit=SPEED Set max download speed in bytes per sec.
    0 means unrestricted.
    You can append K or M(1K = 1024, 1M = 1024K).
    Default: 0
    -T, --torrent-file=TORRENT_FILE The file path to .torrent file.
    --follow-torrent=true|false Setting this option to false prevents aria2 to
    enter BitTorrent mode even if the filename of
    downloaded file ends with .torrent.
    Default: true
    -S, --show-files Print file listing of .torrent file and exit.
    --direct-file-mapping=true|false Directly read from and write to each file
    mentioned in .torrent file.
    Default: true
    --listen-port=PORT Set port number to listen to for peer connection.
    --max-upload-limit=SPEED Set max upload speed in bytes per sec.
    0 means unrestricted.
    You can append K or M(1K = 1024, 1M = 1024K).
    Default: 0
    --select-file=INDEX... Set file to download by specifing its index.
    You can know file index through --show-files
    option. Multiple indexes can be specified by using
    ',' like "3,6".
    You can also use '-' to specify rangelike "1-5".
    ',' and '-' can be used together.
    --seed-time=MINUTES Specify seeding time in minutes. See also
    --seed-ratio option.
    --seed-ratio=RATIO Specify share ratio. Seed completed torrents until
    share ratio reaches RATIO. 1.0 is encouraged.
    If --seed-time option is specified along with
    this option, seeding ends when at least one of
    the conditions is satisfied.
    -v, --version Print the version number and exit.
    -h, --help Print this message and exit.

    URL:
    You can specify multiple URLs. All URLs must point to the same file
    or downloading fails.

    FILE:
    Specify files in multi-file torrent to download. Use conjunction with
    -T option. This arguments are ignored if you specify --select-file option.

    Examples:
    Download a file by 1 connection:
    aria2c http://AAA.BBB.CCC/file.zip
    Download a file by 2 connections:
    aria2c -s 2 http://AAA.BBB.CCC/file.zip
    Download a file by 2 connections, each connects to a different server:
    aria2c http://AAA.BBB.CCC/file.zip http://DDD.EEE.FFF/GGG/file.zip
    You can mix up different protocols:
    aria2c http://AAA.BBB.CCC/file.zip ftp://DDD.EEE.FFF/GGG/file.zip

    Download a torrent:
    aria2c -o test.torrent http://AAA.BBB.CCC/file.torrent
    Download a torrent using local .torrent file:
    aria2c -T test.torrent
    Download only selected files:
    aria2c -T test.torrent dir/file1.zip dir/file2.zip
    Print file listing of .torrent file:
    aria2c -T test.torrent -S

    Report bugs to <tujikawa at users dot sourceforge dot net>

    相关链接




    仅奉献此文以纪念这特别的一天

    14 条评论:

    Chen Bo 说...

    你最后给出的链接,在中国大陆一般访问不了wiki,建议干脆发个帖子详细讲讲如何可以看到。呵

    匿名 说...

    Many of my friends seem to gravitate to the cruiser, maybe trying to recapture that Easy Rider / Biker image from their youth. [url=http://www.michaelkorsehandbags.com]michael kors handbags[/url]
    [url=http://www.uggbootonlinesale.co.uk]ugg outlet[/url] pcailvz jnshkva [url=http://www.michaelkorshangbagsshop.com]michael kors sale[/url] hpdzhqn [url=http://www.uggssnowbootssale.com]uggs outlet[/url] klkantc
    pooskxb [url=http://www.beatsbydresoutletsa.com]dr dre beats[/url]

    匿名 说...

    http://legitpaydayloansonline1.com/ http://www.legitpaydayloansonline1.com/ Fundpopog [url=http://www.legitpaydayloansonline3.com/]Payday loans online[/url] Stype payday loans online Payday Loans Online Applicant doesn't need to place collateral for the the trade commission) and the cfa payday loan.

    匿名 说...

    One can accept financial bottoming out does not Roger put much ability in accounts payable affluence. [url=http://paydayloansjack.co.uk]guaranteed payday loans[/url] For availing online secured loans, borrower should be an assistant with the bimonthly dismissal wage of at few £1200; borrower must have to help with expenses, try an online payday loan. The loan providers of loans usually do to be wary of with regards to the types of loans. Thus, it is a great fiscal OK for those American to $1000 for breakers ahead requirements for a Spartan time span apparently a mile long comity. Businesses Benthamism ampliate financial loans tend to ask a question about the Anschauung of also accessory which makes is cheap and dear. And you find you just don't have enough to pay for it, and what is more, you and £35,000 per calendar year from coming apart into debt. These loans are accessible at low absorb loans to get the balance they need. But there are Tommy Atkins online short-term loan companies that can accord you can go with this sort of loan that is just Geistesgeschichte for you. What is more, cash advances or payday 14-30 days long.

    匿名 说...

    That way, it is possible to calculate your costs and determine if it is going to be a worthwhile purchase. Business Cash Advance Arizo The loan is normally approved with a single day and electronically deposited directly into your looking at account since another morning [url=http://onlinepaydayloans-4u.co.uk/]payday loans online[/url] paul sunu yes, i think it is in the high 80% to 90% ranges. Getting laid far from work or getting fired sometimes happens to. But in certain instances where there exists a high degree of risk it may be made a secured loan online payday loans honestly you must not make a lot more than 4 mortgage requests every year. If you have a 5 inch ruler cut the strip of fabric 5 inches wide. The answer is as follows: Fraser is 28, was born in Corowa, New South Wales and, you know what, lists his interests as music and sports http://onlinepaydayloans-4u.co.uk/ some individuals are just going to obtain them so there isn't reason the reasons you shouldn't receive money from the process that made you spend much.

    匿名 说...

    always i usеd to rеаd smaller articleѕ that аlso clеar their mοtive, аnd thаt is also happening with this post which I am reaԁing
    now. raspberry ketone - raspberry ketone scam -
    raspberry ketone scam

    my ωeb page; raspberry ketone side effects

    匿名 说...

    jordan 11
    ugg sale
    uggs on sale
    ugg outlet online
    uggs sale
    pandora jewellery
    mcm backpack
    discount uggs
    ugg outlet
    guess outlet store
    cheap beats by dre
    cheap ugg boots
    kobe bryant shoes
    nike shoes
    tods shoes
    nike kd 6
    louboutin shoes
    uggs sale
    mcm bags
    uggs on sale
    ugg boots sale
    lebron james shoes
    cheap ugg boots
    north face sale
    the north face outlet
    ysl shoes
    ugg boots sale uk
    discount uggs
    tods shoes
    kevin durant shoes
    ugg uk
    ugg sale
    ugg boots for cheap
    ugg boots cheap
    ugg boots clearance sale
    cheap uggs uk
    ugg boots outlet
    ugg boots sale uk
    ugg outlet

    柯云 说...

    2016-05-07keyun
    ralph lauren home
    ray ban eyeglasses
    hollister clothing store
    coach outlet clearance
    louis vuitton outlet online
    ghd hair straighteners
    concords 11
    coach outlet store
    instyler
    louis vuitton handbags
    ray ban sunglasses wholesale
    ray ban sunglasses
    reb christian louboutin
    air jordan shoes
    adidas originals store
    louis vuitton bags
    coach outlet
    ray bans
    air max 95
    louboutin shoes
    coach outlet
    ray ban sunglasses
    polo ralph lauren
    christian louboutin outlet
    coach factory outlet online
    christian louboutin shoes
    hollister shirts
    kd 8
    michael kors handbags
    kobe 8
    ray ban outlet
    louis vuitton handbags
    michael kors bags
    air jordan homme
    louis vuitton outlet online
    hollister clothing
    fitflop shoes
    cheap ray ban sunglasses
    michael kors outlet online

    Unknown 说...

    20160922qiujie
    canada goose outlet
    true religion jeans outlet
    cheap uggs
    michael kors bags
    uggs outlet
    michael kors outlet online
    uggs on sale
    ugg boots sale
    supra shoes
    cheap nfl jerseys

    Unknown 说...

    adidas nmd r1
    chicago bulls jersey
    salomon boots
    michael kors handbags wholesale
    longchamps
    coach handbags
    yeezy boost 350 white
    fitflops sale clearance
    air force 1 shoes
    ed hardy uk

    Unknown 说...

    pandora bracelet
    longchamp handbags
    adidas nmd
    retro jordans
    true religion
    adidas nmd
    nike roshe run
    hermes birkin
    adidas stan smith

    raybanoutlet001 说...

    falcons jersey
    air huarache
    49ers jersey
    coach outlet
    colts jerseys
    instyler max
    new york jets jerseys
    coach outlet
    hermes belts
    nike factory outlet

    Unknown 说...

    polo ralph lauren
    michael kors handbags
    oakley sunglasses
    ray ban sunglasses outlet
    michael kors canada
    mbt shoes
    michael kors outlet online
    nike store
    mont blanc pens
    instyler max

    Unknown 说...

    qzz0414
    cheap ray bans
    cheap ray ban sunglasses
    buffalo bills jerseys
    nike huarache
    clippers jersey
    chargers jerseys
    oakley sunglasses wholesale
    prada outlet
    polo ralph lauren
    san francisco 49ers jerseys