ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:32.13KB ,
资源ID:4273569      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4273569.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(实现rTorrent的下载分类管理.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

实现rTorrent的下载分类管理.docx

1、实现rTorrent的下载分类管理实现rTorrent的下载分类管理(任务数自定义)目前可以实现而又非常必要的目录分组功能大体如下:(1)设定若干个不同的watch目录,并且都有相应的watch_wait目录放等待种子每个watch目录有自己的ratio分享率,在ratio达到后自动存放到相应分类目录。(2)自动监测下载任务数(不包含seeding的种子),定义总数为12。(3)在下载完成后进行一系列动作,包括4G以上文件合并、watch目录下的种子文件自动删除。目前已经全部实现,完美分组管理并实测全部正常运行。(1)要将文件夹全面重新规划,按照自己喜欢的方式分类。(已经下载的所有文件也可以利

2、用相应的命令全部转移,但比较麻烦,建议还是就全部重新设定,感兴趣的可以看下面迁移旧文件部分)将rtorrent直接迁移到/pub下,分为.session,watch,queue(下设若干分类文件夹,可任意追加)结构图如下:A.rTorrent程序文件夹/pub /rtorrent /.session /watch /!Game /!Video /!seeding /queue /!Game /!Video /!seedingB.下载文件夹,!working为下载中任务目录,其他为和A中对应的下载后保存位置。/pub /Downloads /!Game /!Video /!seeding /!w

3、orking以上的目录结构时需修改配置文件.rtorrent.rc中的设定有:#下载时临时存放目录以及session存放目录directory = /shares/mss-hdd/Public/Downloads/!workingsession = /shares/mss-hdd/Public/rtorrent/.session 增加相应的不同watch如下:注:已实现区分PT、BT种子的强化方法,强烈推荐混PT站的作此设定,详见下面红色标注的强化方法。标准方法1:分别建立三组监视目录,并在下载完成后转移文件到对应文件夹下。(推荐使用,可自动转移)可以根据自己的情况任意追加和设定分组,只要修改

4、d.set_custom1=后面的目录位置即可。schedule = wd_1,10,10,load_start=/pub/rtorrent/watch/!seeding/*.torrent,d.set_custom1=/pub/Downloads/!seedingschedule = wd_2,20,10,load_start=/pub/rtorrent/watch/!Game/*.torrent,d.set_custom1=/pub/Downloads/!Gameschedule = wd_3,30,10,load_start=/pub/rtorrent/watch/!Video/*.to

5、rrent,d.set_custom1=/pub/Downloads/!Videoon_finished = move_complete,d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1=标准方法2:分别建立三组监视目录,直接将文件保存到对应文件夹下。(不推荐,无法分清未完成和已完成)schedule = wd_1,10,10,load_start=/pub/rtorrent/watch/!seeding/*.torrent,d.set_directory=/pub/Downloads

6、/!seedingschedule = wd_2,20,10,load_start=/pub/rtorrent/watch/!Game/*.torrent,d.set_directory=/pub/Downloads/!Gameschedule = wd_3,30,10,load_start=/pub/rtorrent/watch/!Video/*.torrent,d.set_directory=/pub/Downloads/!Videoratio可以利用0.8.4版本的新功能进行设定.设定参考如下默认的分享率设定为下面四句。是指当上传大于200M且分享率达到50%时自动关闭任务,或者只要达到

7、分享率100%就关闭ratio.enable= ratio.min.set=50 ratio.max.set=100 ratio.upload.set=200M 每个分组的设定要按照下面设定(如果不设定就是用上面的默认分享率,所以只需要对有特殊需要的进行设定,比如长期挂种)(最小分享率100%并上传100G,最大分享率无限)group.insert_persistent_view = Ratio100group.Ratio100.ratio.enable= group.Ratio100.ratio.min.set=100 group.Ratio100.ratio.max.set=0 group

8、.Ratio100.ratio.upload.set=100000Mschedule = wd_1,10,10,load_start_verbose=/pub/rtorrent/watch/!seeding/*.torrent,d.set_custom1=/pub/Downloads/!seeding, view.set_visible=Ratio100注意此处需要修改对应的watch语句强化方法(混PT站必备)设定语句如下,可用于测试,与标准方法1(有Group共享)的区分在于加入了branch判断语句。schedule语句超长,建议在XP下编辑后再逐一的仔细copy到vi编辑下。sched

9、ule =wd_test,10,10,load_start_verbose=/pub/rtorrent/watch/test/*.torrent,d.set_custom1=/pub/Downloads/test,branch=d.is_private=,d.set_custom2=BT,view.set_visible=RatioBT主义private=后面是两个逗号,第一个逗号后是判断为private的执行命令,第二个是判断为public的执行命令。作用是在载入watch目录下的种子时,自动判断是否为private tracker(PT),BT种子就把任务的custom2设为BT,同时将分

10、享率Group设为RatioBT,PT种子,custom2为空,分享率执行默认Ratio(其实也可custom2设为PT,但置空,是为了以后更多的复杂判断条件预备。)schedule =wd_test,10,10,load_start_verbose=/pub/rtorrent/watch/test/*.torrent,d.set_custom1=/pub/Downloads/test,branch=d.is_private=,set_visible=RatioPT,d.set_custom2=BT,view.set_visible=RatioBT可分别在test中放入一个PT和BT种子,用下

11、面的命令确认效果。print=$d.get_custom2=d.multicall=RatioPT,print=$d.get_name=如果是BT种子,两个命令的输出应该在屏幕上显示BT“,”种子文件名“。再写一个详细范例作为参考,包括了在.rtorrent.rc中与分组有关的全部设定,整个分类管理只须再加上RTqueue.sh的脚本crontab即可。#on执行语句部分#下载完成后将文件转移至指定的custom1文件夹on_finished = move_complete,d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_p

12、ath=,$d.get_custom1=#下载完成后删除watch下.torrent文件on_finished = remove_tied,d.delete_tied=#下载完成后执行4g合并脚本on_finished = 4g,execute=RT4g.sh,$d.get_base_path=,$d.get_custom2= (注:脚本已更新)#删除任务时也将相关文件一并删除(有时会失效,无法解决,是rTorrent本身的问题)on_erase = rm_complete,execute=rm,-rf,$d.get_base_path=#schedule语句,用于监测各分类脚本#测试用分组,

13、可修改部分用红色标注,分别是schedule名称(wd_test),开始时间(30秒后),时间间隔(10秒),监视分类目录(/pub/rtorrent/watch/test/),完成存放目录(/pub/Downloads/test)PT的Ratio分组(RatioPT)schedule =wd_test,10,10,load_start_verbose=/pub/rtorrent/watch/test/*.torrent,d.set_custom1=/pub/Downloads/test,branch=d.is_private=,d.set_custom2=PT,view.set_visibl

14、e=RatioPT#正式分组schedule = wd_1,30,10,load_start_verbose=/pub/rtorrent/watch/!seeding/*.torrent,d.set_custom1=/pub/Downloads/!seeding,branch=d.is_private=,d.set_custom2=BT,view.set_visible=RatioBTschedule = wd_2,30,10,load_start_verbose=/pub/rtorrent/watch/!Game/*.torrent,d.set_custom1=/pub/Downloads/

15、!Game,branch=d.is_private=,d.set_custom2=BT,view.set_visible=RatioBTschedule = wd_3,30,10,load_start_verbose=/pub/rtorrent/watch/!Video/*.torrent,d.set_custom1=/pub/Downloads/!Video,branch=d.is_private=,d.set_custom2=BT,view.set_visible=RatioBT#Ratio设定(只适用于0.8.4版本)#注意:做种默认分享率(seeding)与group.ratio(Ra

16、tioBT)同时有效,所以(seeding)必须是所有组别中最大分享率。#如果需要对应已存在的任务,可以加上下面的一行命令(此句与分组管理无关,可不设置)on_start = VerifyBTset ,branch=d.is_private=,d.set_custom2=BT,view.set_visible=RatioBT#新增system.method.set语句,必须设定,用于对应每个分享率组达到后后续处理(测试时可以在后面加上显示任务名的命令,print=$d.get_name=)。#做种默认分享率(seeding),指当上传大于10G且分享率达到100%或最大分享率200%(如为0则

17、是无限,直到满足10G上传和100%的要求)ratio.enable= ratio.min.set=100ratio.max.set=200 ratio.upload.set=10000M system.method.set=mand,d.close=,d.stop=,d.set_ignore_commands=1#BT分享率,设为最小分享率10%并上传10M,最大分享率20(下载完成后,判断分享率机制就启用,符合的就执行对应的mand语句)group.insert_persistent_view = RatioBTgroup.RatioBT.ratio.enable= group.Ratio

18、BT.ratio.min.set=10group.RatioBT.ratio.max.set=20group.RatioBT.ratio.upload.set=10Msystem.method.set=group.RatioBTmand,d.close=,d.stop=,d.set_ignore_commands=1(2)自动监测下载任务数(不包含seeding的种子),定义总数为10。完成度100%,目前实现的是针对watch和queue两个目录的总数量进行管理,没有涉及分类(实现毫无问题,问题在于按什么规则?似乎没必要或仍想不到每一个分组的任务控制规则)实现整个下载分类管理步骤:queue

19、分类-watch分类-下载完成分类,已经可以实现rt文件完美管理。注:在.rtorrent.rc配置文件中加上:schedule = tied_directory,10,10,start_tied=加入此条后,如果需要暂时关闭任务,必须到screen下ctrl+k(关闭任务),因为ntorrent中的close只能让任务关闭又被启动。但又需要注意该任务会被自动加上I标志,下次要执行任务时要到screen下按I键取消就可以开始下载了。新脚本的作用是:监测watch目录下的种子数,而且支持多级目录,清晰直观。下载任务队列管理脚本RTqueue.sh如下(附件中已上传),把它保存到/opt/bin后

20、,然后crontab -e加入一行*/3 * * * * /opt/bin/RTqueue.sh这是我根据下面这个国外脚本缩减为为简易实用的(国外那个功能更强大)max_active_dl=设最大任务数(128M内存设12为宜)?_dir,是几个相关目录的地址(unknown须建立,用于保存后缀名不是.torrent的文件)logfile保存脚本的纪录(须建立,可任意指定位置)#!/opt/bin/sh # # rTorrent queue manager # rtqm.sh # 2009/01/20 #export LC_ALL=zh_CN.UTF-8 #export TZ=CST-8 ma

21、x_active_dl=10 queue_dir=/shares/mss-hdd/Public/rtorrent/queue watch_dir=/shares/mss-hdd/Public/rtorrent/watch session_dir=/shares/mss-hdd/Public/rtorrent/.session unknown_dir=/shares/mss-hdd/Public/rtorrent/unknown_file logfile=/shares/mss-hdd/Public/log/rtqm.log no_queue_bt=find $queue_dir/. -type f | wc -l | awk print $1; no_watch_bt=find $watch_dir/. -type f | wc -l | awk print $1;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1