rtorrent scripting

view full story

http://www.linuxquestions.org – I am running rtorrent on a remote server mainly for seeding torrents. However, I am also using it to download new media. I wish to share the downloaded torrent media on the web server. This works great for torrents that have finished downloading, however, for torrents that are in the process of downloading, such as large multi-GiB torrents which have slow seeders or no seeders, this creates an issue. The problem is that I have set the rtorrent default download directory to be visible on the web server. Which is what I want, so that people can get the downloaded media via a web server. Then, when I drop a new torrent into the directory that rtorrent watches, it will start downloading the media to the web servers visible directory. When it finishes the download, then it works the way that I want. So that the media is available both as a web download and also as a torrent download. The issue is that when a download is in progress, media that is available on the web server is incomplete. I can manually close a torrent and manually move the media to a different location, then manually tell rtorrent to use the new location for the torrrent (^o)... but that is doing it manually... and if I need to do this with a large number of torrents, it takes a very long time. I want to automate that so that I don't have to mess with it at all. A lot of other software such as utorrent and such can do this automatically, but it seems that feature is missing from rtorrent. rtorrent does offer a scripting function in it's config file that can start a script on completion of a torrent file, however, I have not been able to figure out how to automaticaly stop a torrent seed, move the torrent media to a different location and then tell rtorrent the file is in the new location, then start up the torrent again. Moving a torrents associated media to a new location also initiates a hash check when the torrent is started. Please note that I am not going to use different software. Since rtorrent is shell based and uses curses, it doesn't require GUI features. That saves something like 150 megs of memory for disk caching, etc. rtorrent kicks MUCH ass for this purpose and it uses a tiny amount of system resources. I use screen with rtorrent so that it will run without having to be logged into the system. I also need to limit the bandwidth on Apache so that people can download with the web if they absolutely must, but I would prefer that they used the torrent files. So, I would like to slow down their downloads quite a bit so that more bandwidth is used with rtorrent. As with most Linux issues, there is more than one way to do something. The problem is, I can't even figure out one of those ways right now. (HowTos)