OpenBSD的BT客户端设置

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

OpenBSD的BT客户端设置

帖子 leo » 2010-01-21 13:28

OpenBSD的BT客户端设置
OpenBSD下可以使用rtorrent作为BT客户端完成BT下载的任务:
方法:
以下以i386平台的当前版为例:
1.下载并安装package
因为rtorrent并未包含在系统内,所以我们需要用package方式来安装它,首先在OpenBSD的站点上找到这个packages:

代码: 全选

$ ftp -a ftp.openbsd.org
Connected to openbsd.sunsite.ualberta.ca.
220 openbsd.srv.ualberta.ca FTP server ready.
331 Guest login ok, send your email address as password.
230- Welcome to ftp.openbsd.org at the University of Alberta 
230- in Edmonton, Alberta, Canada.
230- For other mirror sites visit http://www.openbsd.org/ftp.html
..........
..........
230- 
230- *DO NOT* mirror openbsd from this site! use one of the
230- "second level mirrors" listed at http://www.openbsd.org/ftp.htm[url=http://www.openbsd.org/ftp.html]l[/URL]
230- instead of this site. If you mirror from this site you will lose 
230- access to it.
230- 
230- E-mail comments, questions, trouble reports, and complaints
230- to [email protected]. Please drive safely.
230- 
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /pub/OpenBSD/snapshots/packages/i386/
250 CWD command successful.
ftp> ls rtorrent*
150 Opening ASCII mode data connection for '/bin/ls'.
-rw-r--r-- 1 276 125 468385 Sep 19 09:17 rtorrent-0.8.5.tgz
226 Transfer complete.
ftp> quit
 
$ pkg_add rtorrent-0.8.5
............
2.设置rtorrent的参数
rtorrent的配置示例文件是"usr/local/share/examples/rtorrent/rtorrent.rc",我们需要将配置文件".rtorrent.rc"复制到用户的根目录,这里说明一下OpenBSD系统默认的用户根目录在home下,例如存在一个用户9971,那么系统默认的9971的根目录就在/home/9971这个目录下,所以当你以9971的身份登录后,如果要运行rtorrent则需要将".rtorrent.rc"这个配置文件放置在/home/9971这个目录下面。(这里需要注意一下,这个配置文件和示例文件名字不同,前面加了一个点,请注意留心。)

代码: 全选

# cp /usr/local/share/examples/rtorrent/rtorrent.rc /home/9971/.rtorrent.rc
注意这里请以使用BT的用户(本例中假设用户9971来运行rtorrent)登录并建立相关的目录。
我们假设:
你要将BT的下载目录设定为/home/9971/bt;种子存放目录为/home/9971/bt/seed;session目录为/home/9971/bt/session

代码: 全选

# mkdir /home/9971/bt
# mkdir /home/9971/bt/session
# mkdir /home/9971/bt/seed
下面是我的配置文件.rtorrent.rc,读者可根据自己的情况修改。

--------------------------------------------------------------------------------

代码: 全选

# 这里是一个配置示例文件,请将其复制到 ~/.rtorrent.rc,并根据自行的需要启用或修改这些选项,
# 请记住,如果要启用某选项请注释掉其前面的“#”。
# 每个torrent最大和最小的peer数。
min_peers = 10
max_peers = 500
# 以上相同,但指完成的torrents (-1 = 同downloading)。
#min_peers_seed = 10
#max_peers_seed = 50
# 每个torrent最大同时上传数。
max_uploads = 15
# 全局上传或下载速度以KiB计算。 "0" 表示不限速。
download_rate = 0
upload_rate = 0
# 默认torrents的下载目录。
directory = /home/9971/bt
# 默认的session目录,以确保你在同一个session目录内上运行多个rtorrent实例。建议你设置在相关的目录内。
session = /home/9971/bt/session
# 监控一个目录内的新的*.torrent文件, 如果某个*.torrent文件被移出则停止。
schedule = watch_directory,5,5,load_start=/home/9971/bt/seed/*.torrent
schedule = untied_directory,5,5,stop_untied=
# 磁盘空间低于多少则停止运行rtorrent。
#schedule = low_diskspace,5,60,close_low_diskspace=100M
# 当下列情况发生时停止运行:
# 当上传/下载的比例达到设定值,上传量达到多少bytes或上传/下载百分比达到设置值,
# 例如: 当上传/下载比例达到了2.0并上传了200 MB, 或者上传/下载百分比达到了2000%则停止rtorrent运行。
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"
# 向tracker提供的IP地址。
#ip = 127.0.0.1
#ip = rakshasa.no
# 绑定的IP地址
#bind = 127.0.0.1
#bind = rakshasa.no
# 监听的端口范围
#port_range = 6890-6999
 
# 是否开始运行时在监听的端口范围内随机打开端口。
port_random = no
# 任务完成时是否Check hash.
#check_hash = no
# 是否连接UDP trackers.
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
# Encryption options, set to none (default) or any combination of the following:
# 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
# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
# 
dht = on
# UDP port to use for DHT. 
# 
dht_port = 19971
# 启用peer 交换 (不适用于私有的 torrents)
#
peer_exchange = yes
#
# 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
#------------------这里增加一行以便中文目录或文件名可以正确显示------------------------
encoding_list=UTF-8
--------------------------------------------------------------------------------


好了,你保存好这个配置文件后,只要运行rtorrent就可以了,你要停止rtorrent程序只要在终端内按下CTRL+q。

代码: 全选

# rtorrent
虽然是命令行式的BT客户端,但是速度还是不错的,很简单快捷的小程序。


gobsd.org

junfengfan
铜 Cu
帖子: 236
注册时间: 2010-02-03 18:37

Re: OpenBSD的BT客户端设置

帖子 junfengfan » 2012-10-11 12:15

我按您的步骤做,可是根本就不能下载,下载速度是0;您能否再做一遍,我是 openbsd5.1

再问一个: rtorrent 命令后,出现退不到 “#”提示符的状态 

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: OpenBSD的BT客户端设置

帖子 f5b » 2012-10-11 15:14

还真没有在OpenBSD上面用过bt客户端

aria2应该不错,我用过它来批量下载大量零碎文件

Description

aria2 is a multi-protocol & multi-source, cross platform download utility. The supported protocols are HTTP(S), FTP, BitTorrent, Metalink. It can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth.

junfengfan
铜 Cu
帖子: 236
注册时间: 2010-02-03 18:37

Re: OpenBSD的BT客户端设置

帖子 junfengfan » 2012-10-11 21:31

也不知道是不会设置还是什么原因,aria2感觉速度还是没有迅雷快,比迅雷慢多了

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: Re: OpenBSD的BT客户端设置

帖子 f5b » 2012-10-12 8:35

junfengfan 写了:也不知道是不会设置还是什么原因,aria2感觉速度还是没有迅雷快,比迅雷慢多了
迅雷是吸血鬼来的,而且迅雷有特殊通道,切能发现更多资源,可能因为用迅雷的人比aria2多

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 0 访客