Transmission, SickBeard, CouchPotato (Drobo 5N)

I have been tooling around for the past few weeks basically trying to emulate the Usenet bundle, that Ricardo has been so kind to make, but using torrents. I wanted to document what I have done here for anyone else that might be interested.

First I knew I wanted to try my hand at cross compiling for the Drobo and for that, Ricardo and DroboPorts were invaluable. So I set off to compile Transmission for the Drobo 5N and noticed the version on DroboPorts was not the latest version so I followed the instructions for cross compiling Transmission replacing this section

wget -O transmission-2.73.tar.bz2 http://download.transmissionbt.com/files/transmission-2.73.tar.bz2
tar jxf transmission-2.73.tar.bz2
cd transmission-2.73

with

wget -O transmission-2.77.tar.bz2 http://download.transmissionbt.com/files/transmission-2.77.tar.bz2
tar jxf transmission-2.77.tar.bz2
cd transmission-2.77

2.77 being the latest version at the time.

I encourage anyone with the time and even the slightest interest to cross compile something, it was not a bad experience, taught me a lot and brought a new appreciation for the whole process.

For SickBeard and CouchPotato I just followed the DroboPorts instructions for those. I didn’t install SABnzbd or Headphones.

Unique to torrents however is the need/want to seed the content, which is what I have been trying to make work before I made this post.
SickBeard, if set to keep the downloaded files and also process will never stop processing and continually copy and overwrite from the download location to the library location.
I came across this fix which as far as I can tell has not been merged into the source yet but does indeed solve the issue so torrents can continue seeding and SickBeard only processes the files once. To apply the fix I stopped SickBeard renamed the postProcessor.py, postProcessor.pyc, processTV.py and processTV.pyc and copied over the updated versions of those 2 files.

There are a few fixes I came across including scripts to symbolic link which I may look into in the future but for now the above fix works well for me and stops the Drobo from thrashing hard drives.

Also to try to be a bit more efficient I turned off SickBeard’s auto scan and process option and wrote a script to trigger the scan and process only after a torrent is completed.
I created a “scripts” directory in transmission/etc/ in here I put the sickbeard.sh script containing the following

#!/bin/sh

#################################################################################
# These are inherited from Transmission.                                        #
# Do not declare these. Just use as needed.                                     #
#                                                                               #
# TR_APP_VERSION                                                                #
# TR_TIME_LOCALTIME                                                             #
# TR_TORRENT_DIR                                                                #
# TR_TORRENT_HASH                                                               #
# TR_TORRENT_ID                                                                 #
# TR_TORRENT_NAME                                                               #
#                                                                               #
#################################################################################

# The file for logging events from this script
LOGFILE="/mnt/DroboFS/Shares/DroboApps/transmission/var/log/sickbeard.log"

# WGET directory
WGET="/mnt/DroboFS/Shares/DroboApps/wget/bin/wget"

edate() {
  echo "`date '+%Y-%m-%d %H:%M:%S'` $1" >> "$LOGFILE"
}
 
#Update log and trigger SickBeard post process
edate "$TR_TORRENT_NAME is completed, sleeping for 60 seconds" >> $LOGFILE
sleep 60
edate "Awake, telling SickBeard to process downloads" >> $LOGFILE
$WGET -qO /dev/null http://USER:PASS@localhost:8081/home/postprocess/processEpisode?dir=/mnt/DroboFS/Shares/Torrents/Downloads

The LOGFILE can be changed to anywhere you desire I just put it with transmission also the WGET path may need changed if it’s in a different location. Also note if you have a username and password set for SickBeard those will need to be replaced in the link and at the end of the link change the path to the directory that processing is requested.
I had to allow 777 on the log directory in DroboApps/transmission/var so transmission could write the sickbeard.log this is entirely optional the LOGFILE in my script can be commented out I just have it logging the date, time, what torrents is complete and to see if it was sleeping properly for a minute before triggering SickBeard. I have it sleep just in case Transmission is finishing flushing data before SickBeard tries to process.

The last issue I came up against was permissions.
I based my permissions off of Ricardo’s system (post #24).

I SSH into the Drobo 5N and did the following:
I added a media group: “addgroup media”
Added SickBeard user To media user group: “addgroup sickbrd media”
I used this to check my addgroup worked it shows all members of group media: “grep ^media /etc/group”
I navigated to my shares: “cd ~/Shares” which is were I changed the group owner
Changes the group ownership of my media and torrent directories: “chgrp -R media Media” (this will be your media directory/share) “chgrp -R media Torrents” (torrent directory/share)
This lists the permissions I used to check my group ownership and permissions settings: “ls -al”
This sets the permissions and inheritance: “chmod -R 2775 Media” (this will be your media directory/share) “chmod -R 2775 Torrents” (this will be your torrent directory/share)

I needed to allow SickBeard to write to the torrent directory for that fix above to work as it writes a .PROCESSED file to the directory so next time it knows the file has already been processed that is why I added the group to my torrent directory and gave it write permission.

CouchPotato seems to just work once it’s setup with Transmission as a downloader, I can try to help with any specific questions but I don’t recall doing anything special other than setting permissions.

One final note was I wanted to keep users and groups on reboot which Ricardo and I had a small discussion about here

Hope this helps anyone else interested in running a similar bundle to the Usenet Bundle but with Torrents.