Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
rtorrent configuration file with description
# 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.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 1
max_peers_seed = 50
# Maximum number of uploads single torrent may use
max_uploads = 10
# Maximum number of simultaneous downloads
max_downloads_global = 10
# Maximum number of simultaneous uploads
max_uploads_global = 20
# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 300
# Default directory to save the downloaded torrents.
directory = ./leeching
# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = ./.rtorrent
# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=./rtactive/*.torrent
schedule = tied_directory,6,5,start_tied=
schedule = untied_directory,7,5,stop_untied=
# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=2000M
# Periodically save session data
schedule = session_save,240,300,session_save=
# Enable the default ratio group.
# Change the limits, the defaults should be sufficient.
# Upload to a minimum ratio of 4.0
# Upload to a maximum ratio of 20.0
# Upload a minimum of 250 MB
# When seeding ratio is reached close the torrent
system.method.set = group.seeding.ratio.command, d.close=
# Move files to ./unsorted when download completes
system.method.set_key =,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/"
# Port range to use for listening.
port_range = 33101-33199
# Start opening ports at a random position within the port range.
port_random = yes
# 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,try_outgoing,enable_retry,prefer_plaintext
# Sort the main view by ratio
view.sort_current = main,greater=d.get_ratio=
view.sort_new = main,less=d.get_ratio=
view.sort = main
# Sort the seeding view by the upload rate and only show torrents with peers
view.sort_current = seeding,greater=d.get_up_rate=
view.filter = seeding,"and=d.get_complete=,d.get_peers_connected="
view.sort_new = seeding,less=d.get_up_rate=
view.sort = seeding
# Sort the leeching view by name
view.sort_current = leeching,greater=d.get_name=
view.sort_new = leeching,greater=d.get_name=
view.sort = leeching
# Filter the active view by connected peers
view.sort_current = active,less=d.get_name=
view.sort_new = leeching,less=d.get_name=
view.filter = active,d.get_peers_connected=
view.sort = active
schedule = sort_main,11,5,view.sort=main
schedule = sort_seeding,12,5,view.sort=seeding
schedule = sort_leeching,13,5,view.sort=leeching
schedule = sort_active,14,5,view.sort=active
# 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 = auto
# UDP port to use for DHT.
#dht_port = 6881
# Enable peer exchange (for torrents not marked private)
#peer_exchange = yes
|-- leeching
|-- rtactive
|-- sorted
|-- torrents
|-- unsorted

prewk commented Feb 21, 2015

With system.method.set_key =,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/"
rtorrent will complain about the files being moved before being told where, solution is to flip them around:

system.method.set_key =,move_complete,"d.set_directory=./unsorted/;"execute=mv,-n,$d.get_base_path=,./unsorted/"

Got the solution from

thanks for making this, could you put a link in the comments of the script & declare license. im currently linking your script to funtoo linux's wiki via a wget pull.


ghost commented Nov 11, 2015

@prewk, I get the below error when changed to your suggestion
rtorrent: Error in option file: ~/.rtorrent.rc:60: Junk at end of input.

edit: appears i have some reading to do, has to do with ./unsorted directory location.

@livestradamus actually it looks like there is an extra double quote character in @prewk's proposed solution

sheeit commented Aug 14, 2016

Thanks, really helpful. Tells you more about the config file than their official wiki.

ZNikke commented Jan 2, 2017

Isn't the active view missing a view.sort_new, as the item in that section is a redefinition of the leeching sort_new?

Ie, view.sort_new = leeching,less=d.get_name= should really say active instead?

Also, shouldn't the sort_new and sort_current definitions be identical? For example, the main view sorts in reverse order when new items are added to be reversed again when the scheduled update triggers? Or am I missing something fundamental?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment