Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > Editing rtorrent.rc

The configuration file for rTorrent is located at ~/.config/rtorrent/rtorrent.rc


Edit at your own risk. You are responsible for any changes. Please be careful, and only do things you understand how to do. There are a couple things you need to keep in mind:

  1. Be sure this file is saved with \n (LF) line breaks. If you're connecting via SSH and using nano (or similar), this shouldn't be a problem. However, if you're on Windows and are (S)FTP'ing the file to your computer, there's a chance that the line breaks may change. If there aren't LF line breaks, rTorrent will not start.
  2. Please respect the fact that this is a shared server. Hash checking on completion is disabled because most times it will spike the load.normal while it's checking the files. For large torrents, this can take a very long time, and generally isn't even needed.
  3. network.scgi.open_local must not be changed, in order for ruTorrent (and wTorrent) to work. If you choose to use nTorrent or have another reason to connect to rTorrent using xmlrpc, you can access it through HTTPS using:
    Protocol: HTTPS
    Host: server.whatbox.ca
    Port: 443
    Mountpoint: /xmlrpc
    Username: user
    Password: <password>

Manipulating rtorrent.rc

To edit rtorrent.rc you will need to be able to connect to your server through SSH. Changes only take effect after restarting rTorrent. rTorrent can be restarted from your Manage page.

Resetting to default configuration

If you make a mistake, the configuration can be reset to Whatbox defaults by going to your slot's Manage Apps page (this link or via your Manage page) and clicking "Reset config" next to rTorrent.

Backing up and restoring configurations

To make a backup copy of your current configuration before making modifications use:

cp ~/.config/rtorrent/rtorrent.rc ~/.config/rtorrent/rtorrent.rc.backup

To restore a backup use:

mv ~/.config/rtorrent/rtorrent.rc.backup ~/.config/rtorrent/rtorrent.rc

Editing rtorrent.rc

While you can edit rtorrent.rc over FTP, it is recommended that you edit it over SSH. The easiest editor for a beginner to use is nano. For in depth information on nano, see their documentation. Otherwise, stick to the basics:

Open rtorrent.rc using nano ~/.config/rtorrent/rtorrent.rc
Navigate using arrow keys
Save using Ctrl-O
Exit using Ctrl-X


In rtorrent.rc each line represents a command (or setting). Lines prefixed with # are comments. These lines do not affect the configuration of rTorrent.

Common Tasks

Remove data when erasing a torrent:

method.set_key = event.download.normal.erased, rm_complete,"execute2={rm,-drf,--,$d.base_path=}"

Add another watch directory

Replace "watch_directory" with the directory you want watched

directory.watch.added = "~/watch_directory/", load.start

Set a different download directory for a watch directory

Replace "download_directory" with the directory you want torrents to download

method.insert = change_download_dir, simple|private, "load.start_verbose=(argument.0), d.directory.set=~/download_directory/"

directory.watch.added = "~/watch_directory/", "change_download_dir"

Adding more than one watch or download.normal directory

If you wish to add more than one watch or download.normal directory, you must number then sequentially. Example:

directory.watch.added = "~/watch_directory/", load.start
directory.watch.added = "~/watch_directory_another/", load.start
directory.watch.added = "~/watch_directory_yetanother/", load.start

Adding more than one watch or download directory with custom labels

method.insert = load_television, simple|private, "load.start_verbose=(argument.0), d.custom1.set=television"
directory.watch.added = "~/watch_directory/television/","load_television"

method.insert = load_movies, simple|private, "load.start_verbose=(argument.0), d.custom1.set=movies"
directory.watch.added = "~/watch_directory/movies/","load_movies"

Don't start torrents imported through the watch directory automatically

The default behavior is to start everything automatically from the watch folder.

To make all torrents load from the watch folder in a "stopped" state, open your rtorrent.rc file and change load.start:

directory.watch.added = "~/watch_directory/", load.start

to load.normal:

directory.watch.added = "~/watch_directory/", load.normal

Move torrent data to directory based on label

Move torrent data and the torrent's location to a new folder with the same name as the label set in rTorrent:

method.insert = d.get_finished_dir,simple,"cat=~/files/,$d.custom1="
method.set_key = event.download.normal.finished,move_complete,"d.directory.set=$d.get_finished_dir=;execute2=mkdir,-p,$d.get_finished_dir=;execute2=mv,-u,$d.base_path=,$d.get_finished_dir="

You can modify the command to instead copy data to a new directory, without changing the torrent's location used in rTorrent:

method.insert = d.get_finished_dir,simple,"cat=~/completed/,$d.custom1="
method.set_key = event.download.normal.finished,move_complete,"execute2=mkdir,-p,$d.get_finished_dir=;execute2=cp,-R,$d.base_path=,$d.get_finished_dir="

Stop a torrent immediately upon download.normal completion

method.set_key = event.download.normal.finished,stop_complete,"d.stop="