{"id":2262,"date":"2012-01-04T17:17:45","date_gmt":"2012-01-04T09:17:45","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=2262"},"modified":"2019-09-23T09:37:47","modified_gmt":"2019-09-23T01:37:47","slug":"ubuntu-vps-rtorrent-usage","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=2262","title":{"rendered":"linux\u4e0b\u7528rtorrent\u6302pt,bt"},"content":{"rendered":"<p>\u5728centos 6.2 64bit \u4e0b\u9762\u5b89\u88c5rtorrent\u65b9\u6cd5\uff1a<\/p>\n<pre>cd \/etc\/yum.repos.d\nwget http:\/\/yum.aclub.net\/pub\/linux\/centos\/6\/umask\/umask.repo\nrpm --import http:\/\/yum.aclub.net\/pub\/linux\/centos\/6\/umask\/RPM-GPG-KEY-umask\nyum install rtorrent screen<\/pre>\n<p>\u5728\u4e2a\u4eba\u6587\u4ef6\u5939\u4e2d\uff0c\u521b\u5efa\u9700\u8981\u7684\u76ee\u5f55<\/p>\n<pre>cd ~\nmkdir watch # \u7528\u4e8e\u5b58\u653e.torrent\u6587\u4ef6\nmkdir ptfiles # \u7528\u4e8e\u5b58\u653e\u4e0b\u8f7d\u7684\u8d44\u6599\nmkdir session # \u5b58\u653esession<\/pre>\n<p>\u7f16\u5199\u9002\u7528\u4e8e\u672c\u4eba\u7684rtorrent\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre>vim ~\/.rtorrent.rc<\/pre>\n<p>\u5199\u5165<\/p>\n<pre># This is an example resource file for rTorrent. Copy to\n# ~\/.rtorrent.rc and enable\/modify the options as needed. Remember to\n# uncomment the options you wish to enable.\n# Maximum and minimum number of peers to connect to per torrent.\nmin_peers = 40\nmax_peers = 100\n# Same as above but for seeding completed torrents (-1 = same as downloading)\nmin_peers_seed = 10\nmax_peers_seed = 50\n# Maximum number of simultanious uploads per torrent.\nmax_uploads = 15\n# Global upload and download rate in KiB. \"0\" for unlimited.\ndownload_rate = 0\nupload_rate = 0\n# Default directory to save the downloaded torrents.\ndirectory = .\/ptfiles\n# Default session directory. Make sure you don't run multiple instance\n# of rtorrent using the same session directory. Perhaps using a\n# relative path?\nsession = .\/session\n# Watch a directory for new torrents, and stop those that have been\n# deleted.\nschedule = watch_directory,5,5,load_start=.\/watch\/*.torrent\nschedule = untied_directory,5,5,stop_untied=\n# Close torrents when diskspace is low.\nschedule = low_diskspace,5,60,close_low_diskspace=100M\n# The ip address reported to the tracker.\n#ip = 127.0.0.1\n#ip = rakshasa.no\n# The ip address the listening socket and outgoing connections is\n# bound to.\n#bind = 127.0.0.1\n#bind = rakshasa.no\n# Port range to use for listening.\nport_range = 6890-6999\n# Start opening ports at a random position within the port range.\n#port_random = no\n# Check hash for finished torrents. Might be usefull until the bug is\n# fixed that causes lack of diskspace not to be properly reported.\ncheck_hash = yes\n# Set whetever the client should try to connect to UDP trackers.\n#use_udp_trackers = yes\n# Alternative calls to bind and ip that should handle dynamic ip's.\n#schedule = ip_tick,0,1800,ip=rakshasa\n#schedule = bind_tick,0,1800,bind=rakshasa\n# Encryption options, set to none (default) or any combination of the following:\n# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext\n#\n# The example value allows incoming encrypted connections, starts unencrypted\n# outgoing connections but retries with encryption if they fail, preferring\n# plaintext to RC4 encryption after the encrypted handshake\n#\n# encryption = allow_incoming,enable_retry,prefer_plaintext\n# Enable DHT support for trackerless torrents or when all trackers are down.\n# May be set to \"disable\" (completely disable DHT), \"off\" (do not start DHT),\n# \"auto\" (start and stop DHT as needed), or \"on\" (start DHT immediately).\n# The default is \"off\". For DHT to work, a session directory must be defined.\n#\ndht = auto\n# UDP port to use for DHT.\n#\n# dht_port = 6881\n# Enable peer exchange (for torrents not marked private)\n#\n# peer_exchange = yes\n#\n# Do not modify the following parameters unless you know what you're doing.\n#\n# Hash read-ahead controls how many MB to request the kernel to read\n# ahead. If the value is too low the disk may not be fully utilized,\n# while if too high the kernel might not be able to keep the read\n# pages in memory thus end up trashing.\n#hash_read_ahead = 10\n# Interval between attempts to check the hash, in milliseconds.\n#hash_interval = 100\n# Number of attempts to check the hash while using the mincore status,\n# before forcing. Overworked systems might need lower values to get a\n# decent hash checking rate.\n#hash_max_tries = 10<\/pre>\n<p>\u5230\u8fd9\u91cc\uff0crtorrent\u5df2\u7ecf\u914d\u7f6e\u5b8c\u6210\uff0c\u4e3a\u4e86\u7aef\u53e3\u6b63\u5e38\u4f7f\u7528\uff0ccentos\u7684iptables\u91cc\u9700\u52a0:<\/p>\n<pre>iptables -A INPUT -p tcp --dport 6890:6900 -j ACCEPT\niptables -A INPUT -p udp --dport 6890 -j ACCEPT<\/pre>\n<p>rtorrent\u5b8c\u5168\u57fa\u4e8e\u6587\u672c\u5e76\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\uff0c\u4e0d\u53ef\u80fd\u6bcf\u65f6\u6bcf\u523b\u90fd\u5f00tty\u3002\u6240\u4ee5\uff0c\u914d\u5408screen\u6765\uff0c\u6548\u679c\u5f88\u597d(screen&nbsp;-dmS name cmd )<\/p>\n<pre> screen -dmS rtorrent-name rtorrent<\/pre>\n<p>\u5728rtorrent\u7684\u754c\u9762\uff0c\u5e38\u6267\u884c\u7684\u64cd\u4f5c\u662f<\/p>\n<p>Ctrl-s<\/p>\n<p style=\"padding-left: 30px;\">Start download. Runs hash first unless already done.&nbsp;\u5b9a\u4f4d\u5230\u4e00\u4e2a\u79cd\u5b50\u540e\uff0c\u4f1a\u5148\u68c0\u67e5hash\u5f00\u59cb\u4e0b\u8f7d\uff0c\u4e00\u822c\u662f\u81ea\u52a8\u4e0b\u8f7d\u7684<\/p>\n<p>Ctrl-d<\/p>\n<p style=\"padding-left: 30px;\">Stop an active download or remove a stopped download\uff0c\u6309\u4e00\u6b21\u6682\u505c\uff0c\u518d\u6309\u4e00\u6b21\u5220\u9664\u6b64\u4efb\u52a1\u53catorrent\u6587\u4ef6(\u4e0d\u4f1a\u5220\u9664\u5bf9\u5e94\u7684\u4e0b\u8f7d\u6587\u4ef6)<\/p>\n<p>a\/s\/d \u589e\u5927\u4e0b\u8f7d\u901f\u5ea6\u9650\u5236\u5206\u522b\u4e3a 1\/5\/50 KB.<br \/>\nz\/x\/c \u51cf\u5c11\u4e0b\u8f7d\u901f\u5ea6\u9650\u5236\u5206\u522b\u4e3a&nbsp;1\/5\/50 KB.<br \/>\nA\/S\/D \u589e\u5927\u4e0a\u4f20\u901f\u5ea6\u9650\u5236\u5206\u522b\u4e3a&nbsp;1\/5\/50 KB.<br \/>\nZ\/X\/C \u51cf\u5c11\u4e0a\u4f20\u901f\u5ea6\u9650\u5236\u5206\u522b\u4e3a&nbsp;1\/5\/50 KB.<\/p>\n<p>Ctrl-q<\/p>\n<p style=\"padding-left: 30px;\">Quit application &nbsp;&nbsp;\u9000\u51fartorrent<\/p>\n<p>\u5b98\u65b9\u6587\u6863<\/p>\n<p><a title=\"rtorrent wiki\" href=\"https:\/\/wiki.archlinux.org\/index.php\/RTorrent\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.archlinux.org\/index.php\/RTorrent<\/a><\/p>\n<p>\u5f53\u6b63\u5e38\u4e0b\u8f7d\u4e4b\u540e\uff0c\u4f7f\u7528screen\u7684\u5982\u4e0b\u7ec4\u5408\u952e\uff1a<\/p>\n<p>(ctrl + a ) +d<\/p>\n<p>\u4f7f\u5f53\u524dscreen\u4f1a\u8bdddetached\uff0c\u5e38\u7528\uff0c\u7b80\u5355\u7684\u6765\u8bf4\u5c31\u662f\u628artorrent\u653e\u5165\u540e\u53f0\u3002<\/p>\n<p>\u4e0b\u8f7d magnet \u94fe\u63a5\uff1a<\/p>\n<pre>https:\/\/openwares.net\/2016\/12\/04\/rtorrent-magnet-download\/\nload \u52a0\u8f7d\u8f93\u5165 magnet \u94fe\u63a5\u5373\u53ef\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728centos 6.2 64bit \u4e0b\u9762\u5b89\u88c5rtorrent\u65b9\u6cd5\uff1a cd \/etc\/yum.repos.d wget http:\/\/yum.aclub.net\/pub\/linux\/centos\/6\/umask\/umask.repo rpm &#8211;import http:\/\/yum.aclub.net\/pub\/linux\/centos\/6\/umask\/RPM-GPG-KEY-umask yum install rtorrent screen \u5728\u4e2a\u4eba\u6587\u4ef6\u5939\u4e2d\uff0c\u521b\u5efa\u9700\u8981\u7684\u76ee\u5f55 cd ~ mkdir watch # \u7528\u4e8e\u5b58\u653e.torrent\u6587\u4ef6 mkdir ptfiles # \u7528\u4e8e\u5b58\u653e\u4e0b\u8f7d\u7684\u8d44\u6599 mkdir session # \u5b58\u653esession \u7f16\u5199\u9002\u7528\u4e8e\u672c\u4eba\u7684rtorrent\u914d\u7f6e\u6587\u4ef6 vim ~\/.rtorrent.rc \u5199\u5165 # This is an example resource file for rTorrent. Copy to # ~\/.rtorrent.rc and enable\/modify the options as needed. Remember to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-2262","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2262"}],"version-history":[{"count":30,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2262\/revisions"}],"predecessor-version":[{"id":8594,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2262\/revisions\/8594"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}