Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been using rtorrent for a while with a single directory. Now I figured out it was possible to use different directories and even to move completed downloads elsewhere, so according to the rtorrent wiki I edited my .rtorrent.rc as follow :

# Download directory
directory = /Medias/torrents/

# Watching directories
schedule = watch_directory_1,5,60,"load_start=/path/to/dl/dir1/*.torrent,d.set_custom1=/path/to/done/dir1"
schedule = watch_directory_2,5,60,"load_start=/path/to/dl/dir2/*.torrent,d.set_custom1=/path/to/done/dir2"

# On completion, move the torrent to the directory from custom1.
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1="

It seems to work for new torrents. However I have a bunch of completed files I have already downloaded before to split directories, and for them it does not work : if I delete their file in the session directory, rtorrent will check the hash but won't move them, and if I move them by myself rtorrent won't see them and will try to redownload them.

So how can I tell rtorrent either to move them or that they are in another directory ?

Thanks.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Ok, just figured this out. Within rtorrent you can open a command line using Ctrl+X. You can do many things from there (I guess this is basic rtorrent management), like printing things (print=$variable=, e.g. print=$d.get_directory=), executing commands (execute=command), or setting variables (variable=newvalue).

From this prompt you can move the finished torrent elsewhere, BUT note that it is neither necessary nor sufficient (see below). For instance, using the example from the .rtorrent.rc file given in the original question :

execute=mv,-u,$d.get_base_path=,$d.get_custom1=

However, this command will prevent rtorrent from continuing to seed the torrent, which is why it is not sufficient. In order to continue seeding, you should, still from this command prompt, set the download directory for this torrent to the new location :

d.set_directory=/path/to/new/directory/

Finally, the execute command is not necessary : you can move the torrent the way you want (i.e. outside rtorrent), as long as you set the new directory as explained above.

After that it may be necessary to reopen the torrent (if it's marked as [CLOSED]) using Ctrl+R.

share|improve this answer
    
The correct order is FIRST set the new directory, then move it, btw. And you can add a shorthand command via "method.insert", that does both of the above steps. –  pyroscope Apr 11 '12 at 5:33
    
Right, indeed. Thanks ! –  Skippy le Grand Gourou Apr 11 '12 at 20:06
    
@pyroscope why is set directory first "correct"? It seems to me that you'd want to wait to see if your mv is successful before updating the directory. –  g33kz0r Oct 31 '13 at 11:52
    
Nevermind, answered my own question: <Fault -503: 'Cannot change the directory of an open download atter the files have been moved.'> –  g33kz0r Oct 31 '13 at 12:53

If you're not allergic to symlinks, one way is rtmv.

share|improve this answer
    
For this particular case I find my solution cleaner, but there are quite interesting commands in your link. Thanks. –  Skippy le Grand Gourou Apr 10 '12 at 20:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.