rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

rtorrent gets unresponsive when moving files #1151

Open morbificagent opened 2 years ago

morbificagent commented 2 years ago

Hi together,

i am playing with rtorrent for a few weeks now and have the problem that it gets unresponsive when i move files around. At the moment its done by:

method.insert = d.get_finished_dir, simple, "cat=/xxx/xxx/xxx/seeding/,$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, "execute=mkdir,-p,$argument.1=; execute=cp,-r,--no-preserve=mode,$argument.0=,$argument.1=; d.stop=; d.directory.set=$argument.1=; d.start=;d.save_full_session=; execute=rm, -r, $argument.0=" method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.get_data_full_path=,$d.get_finished_dir="

which is working great except of the unresponsiveness in the time of moving the files. The systemload is ~0.6 in this time so it looks like it is only waiting for the process to be finished. Because it can take some hours when the files are bigger (the destination is on a slow drive) this is annoying.

Is there any way that rtorrent does the job in the background so i can use it while it is moving the files?

Many thanks

rakshasa commented 2 years ago

If you don't need it to restart you can make it move in the background.

If you are moving within the same filesystem mv should be almost instantaneous.

To make it move and restart, you should write a bash script that does the moving and then adds a file to a watch directory that in turn starts the torrent.

rakshasa commented 2 years ago

Really would be nice to have a way to execute commands after a background execution finishes.

morbificagent commented 2 years ago

Thanks for the answer.

To make it move and restart, you should write a bash script that does the moving and then adds a file to a watch directory that in turn starts the torrent.

I think I am not firm enough in scripting with rtorrent to do this. I'm not sure about different points of it.

Is there any example you know I could use?