Docfuntional

Documentation by Dysphunkional

SABnzbd

SABnzbd is a program that can download files from usenet posts. Several other programs such a SickBeard tie into SABnzbd to download files automatically for you and then organize them when the download is complete. Be sure to install or upgrade the ports collection and portmaster before you begin. This guide is based on the SABnzbd+ install guide at www.ainer.org but modified to work on FreeBSD server instead of Ubuntu/Mint desktop.

(Optional) Install Prerequisites

To get the latest version of SABnzbd we will install it from source but to save time you can install the following packages with a package manager:
archivers/par2cmdline-tbb
devel/tbb
archivers/unrar
databases/py-sqlite3
databases/sqlite3
lang/python27
devel/py-cheetah
devel/py-distribute
textproc/py-markdown
devel/py-utils
news/py-yenc
security/py-openssl
textproc/py-feedparser
textproc/py-chardet

Install SABnzbd

portmaster -P news/sabnzbdplus

Accept the default options for SABnzbd and any dependencies that need to be installed.

Create a directory for post processing scripts

mkdir /usr/local/sabnzbd/postprocessing
chown -R _sabnzbd:_sabnzbd /usr/local/sabnzbd/postprocessing

Set SABnzbd to listen on all interfaces instead of just localhost

Edit /usr/local/sabnzbd/sabnzbd.ini and change the line:

host = localhost

to

host = 0.0.0.0

Set the daemon to run at startup

echo 'sabnzbd_enable="YES"' >> /etc/rc.conf

Start SABnzbd for the first time

/usr/local/etc/rc.d/sabnzbd start

SABnzbd Quick Start Wizard

In your browser go to http://server:8080
Choose your language and then click on Start Wizard
Enter your usenet provider setting and then click the Test Server button
SABnzbd Wizard Step One
If you see Connection Successful click the Next button
Select “I want SABnzbd to be viewable by any pc on my network”
Check the “Password protect access to SABnzbd (recommended)” box and enter a username and password
Check the “Enable HTTPS access to SABnzbd” box
SABnzbd Wizard Step Two
Click the Next button
Wait a minute for SABnzbd to restart and then go to https://server:9090/sabnzbd/ in your browser and log in with you new username and password.

Tuning

SABnzbd has a couple settings that you may want to set to increase performance. After logging into SABnzbd click on the Config link at the top

SABnzbd Config Link

Click on the General from the menu on the left

SABnzbd Config General Link

Scroll down to the Tuning section

Setting the Download Speed Limit will prevent SABnzbd from taking all your bandwidth while it is downloading. A good rule of thumb is to set it to 50% of your ISPs claimed download rate. Most ISPs will list their speed in Mbps (megabits per second) and SABnzbd expects the speed limit in KB/s (kilobytes per second) so you will have to do a little bit of math to convert your ISP’s units to SABnzbd’s units. There are 8 bits per byte and when dealing with network speeds there are 1024 kilobits in a megabit. So the formula to convert from Mbps to KB/s would be.

Mbps \times \frac{1024}{8} = KB/s which simplifies to Mbps \times 128 = KB/s

So if you had a 25 Mbps connection which is 3200 KB/s  (25 x 128 = 3200) and you wanted to give SABnzbd half of that bandwidth you would set the Download Speed Limit to 1600 KB/s. (3200 / 2 = 1600)

The Article Cache Limit uses RAM to keep from using the hard disk as much. If you have less than 1GB of RAM set this to something like 32M or 64M. If you have less than 4GB of RAM set it to 128M and if you have more than 4GB of RAM set it at 256M.

Click the Save Changes button.

SABnzbd Config General Tuning

Look up the API and NZB keys

3rd party programs that use SABnzbd to download for them need to have a way of sending requests. To make sure only authorized programs can request things SABnzbd uses keys that you copy and paste into the 3rd party program. To look them up click on the Config link at the top

SABnzbd Config Link

Click on the General from the menu on the left

SABnzbd Config General Link

You can see the keys near the bottom of the SABnzbd Web Server section.

SABnzbd Config General Keys

Folders

You need to tell SABnzbd where to save and find files. These settings are dependent on how you plan to use SABnzbd so I will give you my recommendations and reasons for my choices but you are free to pick your own locations.
SABnzbd Folders

Running inside a FreeNAS Jail

If you are running inside a FreeNAS jail make sure you have given the jail storage. You should also create a user on FreeNAS for SABnzbd. Run the following command in the jail to find out the User ID to use.

id _sabnzbd

Use these settings when creating the new user:

  • User ID: uid from the id command
  • Username: _sabnzbd
  • Shell: nologin
  • Full Name: SABnzbd Usenet Client
  • Disable password login box: Checked

Temporary Download Folder

This is where SABnzbd stores files as they are being downloaded. Because I’m running SABnzbd inside a FreeNAS jail and I want to eventually make my files available on my Public zfs dataset I will put the temporary files there too so when they are complete they can be moved instead of copied from one dataset to another. So in my case I put my temporary downloads in /mnt/shares/Public/SABnzbd/incomplete.

Minimum Free Space for Temporary Download Folder

If you have less than space available then set here SABnzbd will pause downloading. A good rule of thumb is to make sure you always have at least 10% of your drive free at any time. I have a 9TB zfs pool so I pick 900G for this.

Completed Download Folder

This is where SABnzbd will put downloaded files once they have finished downloading. I have a share called Public that is wide open to anyone in my house. I set my completed folder to /mnt/shares/Public/SABnzbd/complete.

Permissions for completed downloads

This setting determines who can read, write, or execute the competed files. I choose 775 for this setting so the _sabnzbd user and any members of the _sabnzbd group have full access to the files and anyone else can read and execute the files. For more information on what permissions are available on a Unix file system see Numeric notation.

Watched Folder

This is where SABnzbd looks for new nzb files to download. I put this on my Public share at /mnt/shares/Public/SABnzbd/watch so I can drop a file in here and have SABnzbd download stuff for me. If you don’t want to use this feature you can just leave the box empty.

Watched Folder Scan Speed

This determines how often SABnzbd will look for new nzb files. I leave this at the default of every 5 seconds.

Post-Processiong Scripts Folder

This is where SABnzbd will look for scripts from 3rd party programs to run on completed downloads. Set this to the post processing directory we created earlier, /usr/local/sabnzbd/postprocessing.

Email Templates Folder

If you need to set up custom email templates for SABnzbd for some reason set the path to them here. I don’t use this feature.

Password file

If you download RAR files that are password protected and you want SABnzbd to try to open them set this to the location of a text file listing all the possible passwords. I don’t use this feature.

Save Changes

Click this once you have all your settings the way you want them.

Switches

This page has a lot of options but most can be left at their defaults.

General Section

Check for New Release should be left on, Launch Browser on Startup should be turned off. Using a 12 or 24 hour clock is up to you.

Server Section

Just leave everything at their defaults in this section.

Queue Section

Turn on Pause Downloading During Post-Processing and leave the rest of the options at their defaults.

Post processing Section

If you don’t use samples set Ignore Samples to Do not download.

Turn Enable Quick Check off. This feature breaks some downloads that would have worked with it turned off so it is safer to leave this setting turned off.

Leave the rest of this section on the default settings.

Naming Section

You can leave this section at its defaults.

Quota Section

If your ISP limits how much you can download you can set SABnzbd to keep track of how much it downloads and stop when it reaches that quota. You might want to set it a bit lower than your actual limit to give you headroom for your web browsing and anything else you do on the internet.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: