view · edit · print · history

How to install CTorrent on OpenSlug:

Using ipkg to install CTorrent:

ipkg install ctorrent

If you are behind a firewall, you need to open at least port 2706 TCP incoming. CTorrent starts trying port 2706, and if it fails it starts counting downwards towards 2106 TCP.

You might want to install screen (ipkg install screen), so that you can run ctorrent in a screen session:

@@screen -dmS torrent ctorrent <torrentfile>@@

CTorrent uses quite a bit of memory (Currently, it's using about 58% on my slug), so you might run into problems if you run a lot of services on your slug.

The memory usage is adjustable with -C. The default cache size is 16MB, which explains the high mem usage. In the script below, it's changed to 4MB which is no problem for most slugs. Feel free to change it ;-)

Below is the script I use to automatically download torrents I save on a share: This script is run as a cron-job every now and then.

I start it as a screen session with "*/2 * * * * screen -dmS torrent /path/to/script"

It's not advanced, and doesn't check much for errors. Feel free to update it a bit ;-)

It doesn't handle filenames with spaces/special chars. You'll need mailx and ssmtp for it to be able to send mail

set -x
SEED_TIME="1"   # Seed for X hours after finishing
MAX_KB="40"      # Limit bandwidth usage to 40KB/s
MAX_CON="200"    # Limit maximum connections to 200
CACHE_SIZE="4"   # Cache size 4MB instead of the default 16MB

[ -e $TORRENTDIR/Working.txt ] && exit
TORRENTFILE=`find . -maxdepth 1 -name "*.torrent" | head -n 1 | cut -d "/" -f 2`
[ "$TORRENTFILE" = "" ] && exit
echo | mail -s "Torrent started: $TORRENTFILE" $MAIL
echo | mail -s "Torrent finished: $TORRENTFILE" $MAIL
rm $TORRENTDIR/Working.txt

My ctorrent was getting killed because it was hogging all the memory. Solution: add swap. http://www.nslu2-linux.org/wiki/HowTo/AddAdditionalSwapSpace

view · edit · print · history · Last edited by Miikka.
Based on work by Stein, Eiffel, tman, and repvik.
Originally by repvik.
Page last modified on December 06, 2007, at 03:42 PM