YOUR CHANNEL IS LOADING
  • 1

    iPhone 5 VS 4s - Worth the upgrade?

  • 2

    XBMC for Raspberry PI - Raspbmc

  • 3

    Raspberry Pi - Overview

  • 4

    Apple Macbook Pro Retina Unboxing and Air Comparison

  • 5

    Pox Unbox - Nintendo 3DS LX

Too Smart Guys FreeNAS Bittorrent Client Setup

MEVIOtoday

Aug 16, 2010 FreeNAS Bittorrent Client Setup

FreeNAS’ Bittorrent Client enabled to use a Blocklist and Schedules


  1. Enabling Transmission (bittorrent client)
  1. Navigate Chrome to FreeNAS URL and login
  2. Navigate to Services -> Bittorrent
  3. Check the Enable box
  4. Go over each options and explain their meaning and recommended settings
Add system variables to enable Transmission's blocklist
  1. Navigate to System -> Advanced -> rc.conf tab
  2. transmission_blocklist=YES, and transmission_noblocklist=NO
Create Blocklist Updating Script
  1. Navigate to: http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=60&t=519&st=0&sk=t&sd=a&start=20#p5515
  2. Copy and save the script locally
  3. Transfer the script over to a directory
  1. NOTE: account has to be in staff group to edit
Navigate to Advanced -> CommandChange permissions on the script to be executable
  1. chmod 774 /path/to/update_script.sh
Change owner and group to transmission:staff
  1. chown transmission:staff /path/to/update_script.sh
  2. NOTE: Write down the full path to the script, the cron tab doesn’t have a file browser
Add cron job for script
  1. Navigate to System -> Advanced -> Cron tab
  2. Add a job for the blacklist script (you can set whatever time/day you wish)
Add cron jobs to set bandwidth limits
  1. Naviate to System -> Advanced -> Cron tab
  2. The command for unlimited upload/download is: “/usr/local/bin/transmission-remote --no-uplimit --no-downlimit --auth admin:xxxxxxxx
  3. The command for limited upload is: /usr/local/bin/transmission-remote --uplimit 2 --downlimit 95 --auth admin:xxxxxxxx
  4. NOTE: switches require double dashes “--”
  5. NOTE: Transmission uses KiloBYTES for up and down limits. Adjust your numbers accordingly.
  1. i.e. I usually have a 10Kbps limit, that would roughly be 2 KBps.
Change owners on Transmission directories
  1. Navigate to Advanced -> Command
  2. Execute the following:
  1. chown -R transmission $(xml sel -T -t -v "/freenas/bittorrent/downloaddir" /conf/config.xml)
  2. chown -R transmission $(xml sel -T -t -v "/freenas/bittorrent/configdir" /conf/config.xml)
Change Group Permissions on Download Directory
  1. Navigate to Advanced -> File Manager
  2. Log in with your designated admin account for the WebUI
  3. Navigate to where your download directory is located
  4. In the Perm’s column for the directory row, click the permission mask (drwxr-xr-x)
  5. Check the Write box for Group


SHOW NOTES:
Followed this quide, though I used a different update script due to recommendations in the forum post -
http://ejesconsulting.wordpress.com/2009/07/20/bittorrents-in-freenas/

Update owner for dirs: http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=60&t=853



Blocklist Update Script

!/bin/sh
# 2009-02-20
PATH=/bin:/sbin:/usr/bin:/usr/local/bin; export PATH;
URL=http://download.m0k.org/transmission/files/level1.gz
DIR=`xml sel -T -t -v "/freenas/bittorrent/configdir" /conf/config.xml`
cd ${DIR}blocklists/
# Get local file size
LocalSize=`stat -qf %z ${URL##*/}`
# Get remote file size or exit
RemoteSize=`fetch -apsw 5  ${URL} || exit 1;`
# If local file size not equal to remote file size update blocklist
if [ ${LocalSize:-0} -ne ${RemoteSize} ]; then
       fetch -apw 5 $URL && \
       gzip -dfkq ${URL##*/} && \
       echo "Blocklists updated on: $(date)" >> ${DIR}transmission_blocklists.log && \
       /etc/rc.d/transmission restart
else
       echo "No update available now: `date`"
fi
exit 0