RTorrentCommonTasks

Common Tasks in rTorrent for Dummies

This page is for showing examples on how to use the many options in rTorrent. Only real examples you can apply immediately, no theory at all. Saving torrent state and resume data between sessions
 * 1) Point to a directory where rTorrent will save the torrent files. You
 * 2) may also use relative paths if you want different session
 * 3) directories depending on where you execute rtorrent.
 * 4) session = ./session
 * 1) session = ./session

session = ~/Download/session Watch a directory for torrents
 * 1) Watch a directory for new torrents, restart torrents that have been
 * 2) copied back and stop those that have been deleted.

schedule = watch_directory,10,10,load_start=~/Download/watch/*.torrent schedule = tied_directory,10,10,start_tied= schedule = untied_directory,10,10,close_untied=


 * 1) Watch another directory with a different destination. (0.7.7+)

schedule = watch_directory_2,10,10,"load_start=~/Download/watch_stuff/*.torrent,d.set_directory=~/Download/stuff/" Create symbolic links to indicate the download state
 * 1) Create symlinks in the watch directory with a suffix indicating the
 * 2) download state.

on_start   = link1,"create_link=tied,,.started" on_stop    = link1,"delete_link=tied,,.started" on_finished = link1,"create_link=tied,,.finished" on_erase   = link1,"delete_link=tied,,.finished"


 * 1) Create symlinks in the same directory as the download.

on_start   = link2,"create_link=base_path,,.started" on_stop    = link2,"delete_link=base_path,,.started" on_finished = link2,"create_link=base_path,,.finished" on_erase   = link2,"delete_link=base_path,,.finished"


 * 1) Create a symlink in another directory without a suffix.
 * 2) You need to quote the command in this case.

on_finished = link3,"create_link=base_filename,/files," Move completed torrents
 * 1) When the torrent finishes, it executes "mv -n &lt;base_path&gt; ~/Download/"
 * 2) and then sets the destination directory to "~/Download/". (0.7.7+)

on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,~/Download/ ;d.set_directory=~/Download/"


 * 1) On MacOSX and *BSD.

on_finished = move_complete,"execute=mv,-n,$d.get_base_path=,~/Download/ ;d.set_directory=~/Download/"

Move completed torrents to different directory depending on watch directory
 * 1) Each watch directory adds torrents with the final destination stored
 * 2) in the "custom1" string of the download. You can check this string with
 * 3) ctrl-X then "print=$d.get_custom1=" in the client.

schedule = watch_directory_1,10,10,"load_start=~/Download/watch_stuff1/*.torrent,d.set_custom1=~/Download/stuff1/" schedule = watch_directory_2,10,10,"load_start=~/Download/watch_stuff2/*.torrent,d.set_custom1=~/Download/stuff2/"


 * 1) On completion, move the torrent to the directory from custom1.

on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,$d.get_custom1= ;d.set_directory=$d.get_custom1="


 * 1) the above line for Mac OS X and *BSD.

on_finished = move_complete,"execute=mv,-n,$d.get_base_path=,$d.get_custom1= ;d.set_directory=$d.get_custom1=" Stop torrents after reaching a specified upload ratio
 * 1) stop_on_ratio = min_ratio,min_upload,max_ratio
 * 2) Example:
 * 1) Example:

schedule = ratio,60,60,"stop_on_ratio=200,50M,300" The "stop_on_ratio" command can be scheduled to stop torrents that have reached a specified upload ratio. Only the first parameter is required, the last two may be used to ensure smaller torrents are seeded more. The above example will stop a torrent once it has uploaded 200% of the torrent size, unless less than 50MB has been uploaded and the ratio is below 300%. Use shift-I to make a torrent ignore this and other commands. Scheduling download rate schedule = throttle_1,01:00:00,24:00:00,download_rate=0 schedule = throttle_2,05:00:00,24:00:00,download_rate=25 Every day "throttle_1" gets triggered at 01:00 and sets the download rate to unlimited, while "throttle_2" sets it to 25kb at 05:00. Using this the client may be made to perform a somewhat crude form of bandwidth scheduling.

Using a different configuration file $ rtorrent -n -o import=~/foo.rc The '-n' switch tells rtorrent not to load the default resource file, while the import option loads '~/foo.rc'. Adding fast resume data to torrent files When you are the first seeder for a torrent, rTorrent will normally have to hash-check all files even if you just created the torrent file from them and thus know that they are correct. To eliminate this step, the following Perl script by Josef Drexler can add rTorrent's fast resume data to the torrent file: http://libtorrent.rakshasa.no/downloads/rtorrent_fast_resume.pl. Usage:

$ rtorrent_fast_resume.pl [base-directory] &lt; original.torrent &gt; modified.torrent Then you can distribute the original torrent file and load the modified file into rTorrent and start seeding without needing a hash check. The base directory specifies where the files in the torrent are located, equivalent to the "directory" option in rtorrent.rc. If not specified, the files are assumed to be in the current directory. Note that this script requires the Convert::Bencode module from CPAN, if this module is not available on your system you will need to install it first: $ perl -MCPAN -e 'install Convert::Bencode' Starting rTorrent on System Startup Step 1: Assuming a Debian-based distribution, create /etc/init.d/rtorrent with http://libtorrent.rakshasa.no/attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh?format=raw, editing the Configuration to suit your needs.

Step 2: Make sure it has appropriate permissions: -rwxr-xr-x 1 root root 3000 2007-03-06 22:40 /etc/init.d/rtorrent Step 3: Update your init system (as sudo/su/root):
 * 1) ls -l /etc/init.d/rtorrent
 * 1) update-rc.d rtorrent defaults