Rtorrent
Aus VDR Wiki
Inhaltsverzeichnis |
Beschreibung
War eine weile auf der Suche nach einen Torrent Client, bin über Rtorrent gestolpert, ist schön klein und nicht so ressourcenhungrig.
Bilder
Softwareanforderungen
- rtorrent
- screen (zum steuern via commands.conf)
Installation
Sourcecode ist auf http://libtorrent.rakshasa.no erhältlich, für die meisten Distributionen gibt es Packages, bzw Installationsanweisungen.
Steuerung via commands.conf
Das gröbste läßt sich via screen und commands.conf bequem per OSD aus VDR heraus steuern, dazu ist ein kleines Shellskript zu erstellen.
#!/bin/sh
#
# example script
# CONFIG START
RTORRENT_OPT="-o min_peers=100,max_peers=200,max_uploads=3,upload_rate=85"
TORRENTS_DIR=/video0/torrents
TORRENTS=$TORRENTS_DIR/*.torrent
DUMP=/tmp/rtorrent.dump
# CONFIG END
RTORRENT_BIN=`which rtorrent 2>/dev/null`
PID=$(pidof -o $$ $RTORRENT_BIN)
case $1 in
start)
if [ -z $PID ] ; then
mkdir -p "$TORRENTS_DIR"
echo "starting $RTORRENT_BIN"
screen -dmS rtorrent $RTORRENT_BIN $RTORRENT_OPT -d $TORRENTS_DIR $TORRENTS
else
echo "already running"
fi
;;
stop)
echo $PID | xargs -r kill -6
;;
restart)
$0 stop
$0 start
;;
log)
screen -ls | awk '/rtorrent/ { print $1 }' | xargs -i screen -p rtorrent -S {} -X hardcopy $DUMP
if ! grep -s [a-z] $DUMP ; then
echo "$DUMP not exist or empty"
fi
rm -f $DUMP
;;
key)
screen -ls | awk '/rtorrent/ { print $1 }' | xargs -i screen -p rtorrent -S {} -X stuff $2
screen -ls | awk '/rtorrent/ { print $1 }' | xargs -i screen -p rtorrent -S {} -X hardcopy $DUMP
if ! tail -n 1 $DUMP 2>/dev/null ; then
echo "not exist or empty"
fi
rm -f $DUMP
;;
status)
if [ -n $PID ] ; then
echo "running (PID: $PID)"
else
echo "not running"
fi
;;
*)
echo "Usage: $0 {start|stop|restart|log|status}" >&2
exit 1
;;
esac
exit $?
Zu guter letzt ist die commands.conf um ein paar Einträge zu erweitern.
Starte rtorrent : $PATH/rtorrentrc start Status : $PATH/rtorrentrc log 5 KB + (up) : $PATH/rtorrentrc key s 5 KB - (up) : $PATH/rtorrentrc key x Beende rtorrent? : $PATH/rtorrentrc stop
Zu key <VAR>, einfach mal hier schauen.
http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide
a/s/d Increase the upload throttle by 1/5/50 KB. z/x/c Decrease the upload throttle by 1/5/50 KB. A/S/D Increase the download throttle by 1/5/50 KB. Z/X/C Decrease the download throttle by 1/5/50 KB.
Zu den Variablen.
Hier werden die Downloads gespeichert.
TORRENTS_DIR=/video0/torrents
Die *.torrents werden hier erwartet.
TORRENTS=$TORRENTS_DIR/*.torrent
Das war es schon, wenn aktiviert kann wie folgt der screen auf die Konsole ausgegeben werden.
shell> screen -x rtorrent

