您的位置:首页 > 其它

rtorrent命令行使用说明和安装

2011-12-23 14:07 253 查看

搜索一下网络上关于 rtorrent 的中文说明似乎没有找到,根据原文大致的把命令行操作翻译一下:

添加和删除 torrents

回退键用 URL 或者文件路径添加,采用 tab 键查看目录内容并自动完成,支持通配符,例如: ~/torrent/*
回车键和回退键一样,但是添加的 torrent 保持非激活( inactive )状态 (用 ^s 激活)
^o对选择的 torrent 设置新的下载目录,仅仅对还没有被激活过的 torrent
^s开始下载,先运行 hash ,除非已经做过
^d停止激活的下载,或者删除一个停止的下载
^r初始化 torrent 的 hash 检查
注意: ^s 和 ^q 在 shell 里面经常用来控制屏幕的暂停,这会和 rTorrent 发生冲突,用 stty -a 来检查是否已经被使用,删除的办法是:

stty stop undef
stty start undef

before running rTorrent (or reattaching to screen) to leave them undefined. You could also replace undef with some other code — ^p,
say. ^d also usually sends end-of-file but ncurses passes this through to rTorrent. stty eof undef if you are worried.

To fix this, you may also toggle the flow control in screen with ^a ^f until screen displays “-flow” in
the bottom left corner.

修改带宽

a/s/d增加上传带宽 1/5/50 KB.
z/x/c降低上传带宽 1/5/50 KB.
A/S/D增加下载带宽 1/5/50 KB.
Z/X/C降低下载带宽 1/5/50 KB.

Common Error Messages

Could not parse bencoded dataThis message is caused by bad communication with the tracker, often caused by invalid client authentication (passkey, IP address, etc.)Could not create download, the input is not a valid torrentThis message is caused by a corrupted or otherwise non-valid .torrent file. You should redownload the .torrent file or possibly find a new source for it.

浏览

Global Keys

^q关闭 rTorrent,再按一次,强行关闭
上下箭头选择 torrent
左键回到前一个屏幕

主屏幕视图操作

向右键切换到下载视图
^r检查 hash
+/-修改优先度
l查看日志,空格退出
1显示所有下载
2显示所有下载,按文件名排序
3显示开始的下载
4显示停止的下载
5显示完成的下载
6显示未完成的下载
7显示正在 hash 的下载
8显示正在做种的下载

下载视图

rightSwitch to selected view
leftSwitch to view selection or back to main view
1/2Adjust max uploads.
3/4Adjust min peers.
5/6Adjust max peers.
p显示 peer
o显示 torrent 信息
iDisplay file list
uDisplay tracker list
t/TInitiate tracker request. Use capital T to force the request, ignoring the “min interval” set by the tracker.

Peer list View Keys

leftSwitch to view selection
rightShow peer details
*Snub peer (stop uploading to this peer)
kKick peer (disconnect from peer)

File list View Keys

leftSwitch to view selection
rightShow file details
spaceChange the file priority; applies recursively when done on a directory
*Change the priority of all files
/Collapse directories. While collapsed, press right to expand the selected directory.
Priority options are blank (standard priority), hig (high priority) and off (not to be downloaded).

Tracker list View Keys

leftSwitch to view selection
*Enable/disable tracker
spaceRotate trackers in a group
#################################################################
#################################################################

需要準備下列的檔案自己編譯它

1.curl

2.sigc++-2.0

3.libtorrent

4.rtorrent

* 或是下載筆者所打包的檔案 點我下載

测试安装版本: curl-7.19.4.tar.bz2 libsigc++-2.2.0.tar.bz2 libtorrent-0.12.4.tar.gz rtorrent-0.8.4.tar.gz
如果在安裝 rtorrent ./configure時,出現URL錯誤的話

# cd /usr/lib/pkgconfig

# vi /libcurl.pc

# #URL: <–將這行用#註解起來
安裝:

a.安裝 curl

# tar -zxvf curlxxxxxxx

# cd /curlxxx

# ./configure –prefix=/usr

# make



# make install



如果在安裝 rtorrent ./configure時,出現URL錯誤的話

# cd /usr/lib/pkgconfig

# vi /libcurl.pc

# #URL: <–將這行用#註解起來

b.安裝sigc++-2.0

# tar -zxvf libsigc++20-xxx

# cd libsigc++-2.0.17

# ./configure –prefix=/usr

# make



# make install



c.安裝libtorrent

# tar libtorrent

# cd libtorrent

# ./configure –prefix=/usr

# make



# make install



注意: 在configure curl , sigc++-2.0 , libtorrent 時,多了個 –prefix=/usr 參數 ,因為避免當在編譯libtorrent時會找不到該curl , sigc 的檔案,所以在次多加個 –prefix=/usr 參數, 將該套件安裝在 /usr下

d.安裝rtorrent

# tar -zxvf rtorrent

# cd rtorrent

# ./configure

# make



# make install



執行:

# rtorrent <-執行rtorrent

如果要丟在背景執行則可以使用screen

# screen

# rtorrent

如果要返回前景時,在rtorrent畫面裡按下 ctrl+a 之後 ctrl+d, 則跳回前景, 之後回到rtorrent畫面則輸入

# screen -r



參數設定:

安裝完成後我們需要作一些配置工作,配置文件是安裝用戶家目錄下的.rtorrent.rc。這個文件默認是沒有的,請到這頁面,將示例的配置文件內容拷貝粘貼到.rtorrent.rc中,然後我們來編輯它。將前面的#刪除則是取消註解。

# cp rtorrent.rc ~/.rtorrent.rc

# vi ~/.rtorrent.rc

最大和最小的種子連接數

# Maximum and minimum number of peers to connect to per torrent.

#min_peers = 40

#max_peers = 100

最大上傳數

# Maximum number of simultanious uploads per torrent.

#max_uploads = 15

上傳和下載速度限制 0:無限制

# Global upload and download rate in KiB. “0″ for unlimited.

#download_rate = 0

#upload_rate = 0

下載檔案存放目錄

# Default directory to save the downloaded torrents.

#directory = ./

下載快取目錄

#session = ./session

torrent 檔存放目錄

#schedule = watch_directory,5,5,load_start=./watch/*.torrent

隨機port 範圍

#port_range = 6890-6999

下載檔案名使用 UTF-8 編碼

#encoding_list = UTF-8



常用熱鍵:


1. 方向鍵 : ↑,↓,←,→

2. Torrent 開始下載 : Ctrl + S (Screen下用法為: Ctrl+ a + s)

3. Torrent 暫停下載 : Ctrl + D

4. Torrent 停止下載 : Ctrl + K

5. 清除Torrent下載列表 : [法1] 在停止狀態使用Ctrl + D, [法2] 在下載完成連續執行 Ctrl+D 二次

6. 限定最大上傳速度 : [增加]a / s / d [減少] z / x /c

7. check file hash : Ctrl + R

8. 離開rtorrent程式 : Ctrl+ q (Screen下用法為 : Ctrl+ a + q)

转自: http://blog.shian.tw/linux_rtorrent.html

#####################################################

linux bt速度之王—— rtorrent DHT版本 For Oleg optware(mss可用 )linux bt速度之王—— rtorrent DHT版本 For Oleg optware(mss可用 )

1. Rtorrent的特点

•BT下载 - 高速占内存少而且功能强大,绝不是mldonkey比得上的,mldonkey下电驴还可以考虑,bt的话还是闪一边去吧

速度比拼, 2M/512kbps ADSL

enhanced ctorrent: 80 KB/s mldonkey: 40 KB/s rtorrent: 233 KB/s

o支持协议加密,防止ISP封BT

o支持peer交换,客户端之间交换peer,让每个客户可以连上更多的客户

o支持多Tracker协议, UDP Tracker

o支持选择文件下载,以及调整下载优先级

o支持通过DHT网络实现无种下载

o支持快速恢复(Fast Resume),下载中断后无需重新hash,节约时间

o支持nTorrent(windows)远程控制

2.Rtorrent DHT版本的安装

这个是在oleg optware上运行的,所以必须要先安装oleg optware才能进行后续工作,执行

ipkg update(如果无法运行,则使用/opt/bin/ipkg update,下同)

ipkg install rtorrent

【历史】由于nslu2 optware的官方的svn已经更新,从记录上看,源中的libtorrent和rtorrent已经提供了DHT,所以无需再下载附件中的文件(已删除)。不过以后如果rtorrent有新的功能,也会提前放出来给大家尝鲜,感谢大家的支持

-----------------------------optware 官方更新记录-------------------------------------------

r7590 | oleo | 2008-01-16 14:54:55 +0800 (Wed, 16 Jan 2008) | 1 line

rtorrent: 0.7.9->r1027 with DHT - startup script by al37919

3. Rtorrent DHT版的配置

配置文件应该在/opt/etc下可以找到一个名叫rtorrent.conf的文件,可以在这个文件的基础上做修改,下面是一个例子,#号后面的是注释,不用管他,蓝色标出的是比较重要的配置

################################## 配置文件开始 ####################################

# This is an example resource file for rTorrent. Copy to

# ~/.rtorrent.rc and enable/modify the options as needed. Remember to

# uncomment the options you wish to enable.

# 每个torrent文件允许连接的最大以及最小的peer的数目

min_peers = 40

max_peers = 250

# Same as above but for seeding completed torrents (-1 = same as downloading)

#min_peers_seed = 10

#max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.

max_uploads = 15

# 全局上传和下载速率,单位是KB. "0" 代表无限制

download_rate = 75

upload_rate = 28

# 默认下载目录,下载好的文件会放到这里

directory = /opt/downloads

# Default session directory. Make sure you don't run multiple instance

# of rtorrent using the same session directory. Perhaps using a

# relative path?

session = /opt/downloads/.session

# 下面是一个非常有用的功能:监视目录

# 放在/opt/torrent目录底下的torrent文件会自动开始下载

# 配置好监视目录以后,只要通过samba或scp往这个目录传种子,就会自动开始下载

schedule = watch_directory,5,5,load_start=/opt/torrent/*.torrent

#schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.

#schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,

# when also reaching total upload in bytes, or when

# reaching final upload ratio in percent.

# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0

#schedule = ratio,60,60,stop_on_ratio=200,200M,2000

# The ip address reported to the tracker.

#ip = 127.0.0.1

#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is

# bound to.

#bind = 127.0.0.1

#bind = rakshasa.no

# Port range to use for listening.

#port_range = 6890-6999

# Start opening ports at a random position within the port range.

#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is

# fixed that causes lack of diskspace not to be properly reported.

#check_hash = no

# 是否使用UDP trackers,建议选yes

use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.

#schedule = ip_tick,0,1800,ip=rakshasa

#schedule = bind_tick,0,1800,bind=rakshasa

# 是否允许协议加密,建议改成allow_incoming,enable_retry,prefer_plaintext的组合体,具体原因就不解释了

# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext

#

# The example value allows incoming encrypted connections, starts unencrypted

# outgoing connections but retries with encryption if they fail, preferring

# plaintext to RC4 encryption after the encrypted handshake

#

encryption = allow_incoming,enable_retry,prefer_plaintext

#

# Do not modify the following parameters unless you know what you're doing.

#

# Hash read-ahead controls how many MB to request the kernel to read

# ahead. If the value is too low the disk may not be fully utilized,

# while if too high the kernel might not be able to keep the read

# pages in memory thus end up trashing.

#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.

#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,

# before forcing. Overworked systems might need lower values to get a

# decent hash checking rate.

#hash_max_tries = 10

# Max number of files to keep open simultaniously.

#max_open_files = 128

# Number of sockets to simultaneously keep open.

#max_open_sockets = <no default>

# Example of scheduling commands: Switch between two ip's every 5

# seconds.

#schedule = "ip_tick1,5,10,ip=torretta"

#schedule = "ip_tick2,10,10,ip=lampedusa"

# Remove a scheduled event.

#schedule_remove = "ip_tick1"

#选择utf-8可以在samba中看到中文

encoding_list = UTF-8

#rtorrent创建的文件夹(或文件)的权限,默认是0644,建议改成0000(感谢xuanwuhu),使所有用户都能访问。

#也只有这样在samba中才可以直接打开、拷贝、删除rtorrent创建的文件

umask = 0000

#下面两个选项打开dht的功能,照做即可,另外如果想让 rtorrent 在启动的时候就使用 DHT,可以把dht=auto改为dht=on

dht = auto

dht_port = 6778

#允许peer交换,当然允许了,多多益善啊

peer_exchange = yes

#最后这个参数和web配置以及远程管理有关,稍后再介绍

scgi_port = :5000

################################## 配置文件结束 ####################################

这个配置文件默认放在用户的HOME目录中,因此建议执行以下操作

mkdir /opt/root

export HOME=/opt/root

将以上配置文件更名为.rtorrent.rc,放在/opt/root目录底下

最后在telnet中敲入rtorrent(也可能要输入/opt/bin/rtorrent),就能启动rtorrent,此时往监视目录中放一个torrent文件,就会开始下载,此时注意页面下方是否出现

(14:31:09) Starting DHT server on port 6778.的字样,如果有说明DHT配置成功了

为了达到更好的下载效果,需要在7231-4P或WL500gP的上一级路由上做端口映射(如果是7231-4P或WL500gP直接拨号的话,就不需要了),另外,如果在7231-4P或WL500gP上下载,必须要把iptables的INPUT链的对应的端口打开,可以在ddwrt的启动脚本中加入

iptables -I INPUT 1 -p tcp --dport 1024:10000 -j ACCEPT

iptables -I INPUT 1 -p udp --dport 1024:10000 -j ACCEPT

4. Rtorrent 的使用和管理

rtorrent我个人认为有三种使用方法,1. screen + 监视目录 2.ntorrent远程GUI管理 3.web管理,我个人认为第一种方法是最方便的而且耗资源最少的方法

方法1.screen + 监视目录

这种方法通过监视目录的方式添加种子,然后使用screen进行管理,screen的最最简单用法见本帖第2页56楼

rtorrent的使用方法见下面两篇帖

繁体中文http://discuz.orz101.com/viewthread.php?tid=420&extra=page%3D1

英文http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide

方法2.ntorrent远程GUI管理

第一步,先对rtorrent配置文件做一些修改,注释掉scgi_port = :5000这一行(前面加#),加入下面这行

scgi_local = /opt/var/run/rpc.socket

第二步,安装lighttpd

ipkg install lighttpd

第三步,修改lighttpd配置文件,使用编辑器编辑/opt/etc/lighttpd/lighttpd.conf

首先在server.modules中加入一行

server.modules = (

# "mod_rewrite",

# "mod_redirect",

# "mod_alias",

"mod_access",

# "mod_cml",

# "mod_trigger_b4_dl",

# "mod_auth",

# "mod_status",

# "mod_setenv",

# "mod_fastcgi",

# "mod_proxy",

# "mod_simple_vhost",

# "mod_evhost",

# "mod_userdir",

# "mod_cgi",

# "mod_compress",

# "mod_ssi",

# "mod_usertrack",

# "mod_expire",

# "mod_secdownload",

# "mod_rrdtool",

"mod_accesslog", <------这里加个逗号

"mod_scgi") <-------这是新加的一行

然后在lighttpd.conf的最后加上

scgi.server = (

"/RPC2" =>

( "127.0.0.1" =>

(

"socket" => "/opt/var/run/rpc.socket",

"check-local" => "disable",

"disable-time" => 0, # don't disable scgi if connection fails

)

)

)

保存退出。

第四步,重启rtorrent和lighttpd

/opt/etc/init.d/S80lighttpd stop

/opt/etc/init.d/S80lighttpd start

killall rtorrent

rtorrent

第五步,在windows上安装ntorrent

进入http://code.google.com/p/ntorrent/,点右侧下载nTorrent-bin-20071220.tar.bz2(需要安装java运行库)

双击nTorrent.jar启动ntorrent,在登录窗口选择

protocol : http

host : 你的7231-4P,WL500g或者MSS的IP

port : 8081 (可以在/opt/etc/lighttpd/lighttpd.conf中修改成其他的,默认是这个)

mountpoint : /RPC2

最底下用户名和密码不填,点save然后点connect,如果能连上就可以使用ntorrent远程控制了

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: