5

I've got a seedbox with rTorrent (and ruTorrent) installed, and I'm trying to automate as much as possible...

Currently, I've got this in my rtorrent.rc to move completed files to ~/Download:

system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/Download/;d.set_directory=~/Download/"

And then I've got a script that rsyncs those completed files back to my home computer...

I've got ruTorrent set to apply labels to torrents, and I'd like to move files according to the labels instead of moving them all to the same folder. I can't find any documentation at all, though. There are lots of examples of configuring rTorrent for 'common tasks', but nothing that I've been able to use to infer how to even check labels, never mind move completed torrents according to the labels...

2
  • I've even checked out the source for rTorrent and libtorrent and grepped for "move_complete", and found nothing. What the heck?
    – Asmor
    Commented May 1, 2014 at 4:26
  • If it is not in the source, you could put it in, or write a script that observes (new) files to appear in the output directory and move them according to the label information (which you might e.g. get from the torrent log file if not part of the filename).
    – Anthon
    Commented May 1, 2014 at 4:51

3 Answers 3

5

The ruT label is in custom1 if I remember right, just use $d.custom1= at the proper place in the completion event handler.

And BTW, move_complete is a mere identifier, event.download.finished is what you'll find in the source.

1
  • 4
    Could you describe the "use $d.custom1= at the proper place in the completion event handler" process more?
    – Csharpz
    Commented Jan 1, 2015 at 3:49
5

The following is a quote from this blog:

# Add new method to get finished dir
system.method.insert = d.get_finished_dir,simple,"cat=[folder]/finished/,$d.get_custom1="
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_finished_dir=;execute=mkdir,-p,$d.get_finished_dir=;execute=mv,-u,$d.get_base_path=,$d.get_finished_dir="`

The first line, the system.method.insert thing, basically says that each torrent should be able to return a string which is the concatenation of [folder]/finished/ and the torrent's label. So a torrent with the label tvshows will return [folder]/finished/tvshows. Change the first part to whatever you want your base "finished torrents" directory to be. I haven't tried this with any directories containing spaces, but I’m guessing escaping would be the way to go.

The second line basically says that the torrent should set its internally defined directory to whatever get_finished_dir returns, then create the directory if it doesn’t already exist, and finally move the torrent to the same directory.

Torrents without labels will be placed in the base dir.

Torrents with labels corresponding to already existing folders will be moved to those folders.

Torrents with labels corresponding to folders that don’t already exist will have the folder created for them, then they’ll be moved to that folder.

I'd like to point out that it is crucial to DISABLE Autotools AutoMove feature while using this technique. If you do not disable AutoMove, it will cause an error "Download registered as completed, but hash check returned unfinished chunks.", you will in fact be having two copies of your file (non-deterministic, just a logic link to a file can be created) in [folder]/finished/LABEL_NAME and in wherever you set in AutoMove. This will also cause rTorrent not to be able to seed those files and torrents will be marked as stopped/paused and if you resume the download it will be downloaded all over AGAIN to [folder]/finished/LABEL_NAME directory.

0
0

they supply a script that works well https://rtorrent-docs.readthedocs.io/en/latest/use-cases.html#versatile-move

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .