Rtorrent: Torrents "finish" (fail) on move

Created on 12 Jul 2017  Â·  6Comments  Â·  Source: rakshasa/rtorrent

When using the below - torrents don't continue to seed. All the examples I could find have the d.directory.set command earlier, but that makes the whole command fail (because mv can't find the files to move).

method.insert = d.get_finished_dir, simple, "cat=$directory.default=,complete/,$d.custom1="
method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"
method.set_key = event.download.finished,move_complete,"execute=mkdir,-p,\$d.get_finished_dir=;execute=mv,-u,$d.get_data_full_path=,$d.get_finished_dir=; d.directory.set=$d.get_finished_dir=;d.save_full_session="

Most helpful comment

Looks good, congrats!

All 6 comments

And your fix is to break it further by using the wrong order?

Make the handler body its own method, and pass in the path, then use argument.0 – and alas, the thing is immutable suddenly.

If you like the idea of moving data around then take a look at rtorrent-ps_setup which will do this and a lot more.

The example I ended up using from here has the d.directory.set at the end - but that doesn't appear to work either (the torrent doesn't stay alive)

@pyroscope I'm not sure how to do what you suggested - is there an example somewhere I can work from?

# gets the full path of data of a torrent (it's a workaround for the possibly empty 'd.base_path' attribute)
method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"
method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_data_full_path=,~/Download/; d.directory.set=~/Download/"

I've ended up with the below that appears to work

# ----------------------------------------------------------------------
# Functions
# ----------------------------------------------------------------------
method.insert = d.get_finished_dir, simple, "cat=$cfg.basedir=,complete/,$d.custom1="
method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"
method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
method.set_key                    = event.download.finished,move_complete,"d.move_to_complete=$d.get_data_full_path=,$d.get_finished_dir="

Looks good, congrats!

Cheers @chros73 & @pyroscope - Thank you for your help/feedback

Was this page helpful?
0 / 5 - 0 ratings