Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-31-2010, 05:06 AM   #1
LQ Newbie
Registered: Jan 2010
Posts: 1

Rep: Reputation: 0
rtorrent scripting

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.
Old 01-31-2010, 05:28 AM   #2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
This is how to automate moving finished downloads in rtorrent:


Old 01-31-2010, 05:30 AM   #3
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
Here is one idea:

- let download be the directory in which rtorrent stores files that have been downloaded or are currently being downloaded
- let finished be the directory that users are supposed to access via their web browsers

The script (called when a download has finished) would make a symbolic link from finished/$d to download/$d. This has various implications: both download and finished must be accessible via the web server; the web server must follow symlinks.

Last edited by carbonfiber; 01-31-2010 at 05:34 AM.


apache, rtorrent

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rtorrent no connections danielph Linux - Desktop 5 01-19-2009 04:16 PM
rtorrent on Gentoo properganda Linux - Newbie 2 02-24-2008 09:41 AM
About rtorrent satimis Linux - Software 8 02-19-2008 09:36 AM
About rtorrent satimis Linux - Software 0 05-10-2007 11:34 AM
Problem with rtorrent asininity Linux - Software 12 04-15-2007 02:37 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration