Next: , Previous: , Up: Integration with existing software   [Index]


BitTorrent and huge files

If dealing with Integration with Git, web feeds and multimedia goes relatively fast, then BitTorrent and huge files consumes much time. You can not wait for downloads finish, but want to queue them after.

aria2 multi-protocol download utility could be used for solving that issue conveniently. It supports HTTP, HTTPS, FTP, SFTP and BitTorrent protocols, together with Metalink format. BitTorrent support is fully-featured: UDP trackers, DHT, PEX, encryption, magnet URIs, Web-seeding, selective downloads, LPD. aria2 can accelerate HTTP*/*FTP downloads by segmented multiple parallel connections.

You can queue you files after they are completely downloaded. aria2-downloaded.sh contents:

#!/bin/sh

TORRENTS_DIR=/storage/torrents
REMOTE=stargrave.org

if [ "$2" -eq 0 ]; then
    # downloaded .torrent/.metalink
    exit 0
fi

if [ "$2" -gt 1 ]; then
    cd "$3"
    while [ "$(pwd)" != $TORRENTS_DIR ]; do
        name="$(basename "$(pwd)")"
        cd ..
    done
    tartmp=$(mktemp ./finished.XXXXXX)
    tar cf $tartmp "$name"
    nncp-file $tartmp $REMOTE:"$name".tar
    rm $tartmp
else
    nncp-file "$3" $REMOTE:
fi

Also you can prepare input file with the jobs you want to download:

$ cat jobs
http://www.nncpgo.org/download/nncp-0.11.tar.xz
    out=nncp.txz
http://www.nncpgo.org/download/nncp-0.11.tar.xz.asc
    out=nncp.txz.asc
$ aria2c \
    --on-download-complete aria2-downloaded.sh \
    --input-file jobs

and all that downloaded (nncp.txz, nncp.txz.asc) files will be sent to remote.node when finished.