This article will show you how to install SABnzbd. SABnzbd can be used to download binary files from Usenet servers.
You'll need to execute some commands via SSH to install this software. There is a separate guide on how to connect to your slot via SSH. Commands are kept as simple as possible and in most cases will simply need to be copied and pasted into the terminal window (then executed by pressing the Enter key).
Install SABnzbd by logging in via SSH, then copying and pasting the following:
wget -qO ~/SABnzbd.tar.gz $(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep 'browser_' | cut -d\" -f4 | grep src) tar xf ~/SABnzbd.tar.gz pip install --user sabyenc rm ~/SABnzbd.tar.gz
Configuring before starting SABnzbd
You need to start and then close SABnzbd so that it'll create the necessary configs. Do so with the following command:
SABnzbd will then go through its launch procedure. Eventually you'll come to a setup wizard with language selection. At this point, press ctrl + c to close SABnzbd and create the config.
Then run the following command:
sed -ri "s|host_whitelist = (.*)|host_whitelist = $(hostname -f)|g" ~/.sabnzbd/sabnzbd.ini
Starting, stopping and restarting
This section covers the SABnzbd process - starting it, stopping it and restarting it. It also covers checking if the process is running, in case that becomes necessary.
Replace port in the commands below with a port number between 10000 and 30000. Try to be as consistent as possible - if you change the port, you'll also need to change your proxypass configuration (if appropriate).
- screen -fa -dmS sabnzbd python ~/SABnzbd-*/SABnzbd.py --browser 0 --server $(hostname -f):port
- check running
- pgrep -fu "$(whoami)" "SABnzbd.py"
- pkill -fu "$(whoami)" 'SABnzbd.py'
- pkill -fu "$(whoami)" 'SABnzbd.py' && screen -fa -dmS sabnzbd python ~/SABnzbd-*/SABnzbd.py --browser 0 --server $(hostname -f):port
- kill (force stop)
- pkill -9 -fu "$(whoami)" 'SABnzbd.py'
The check running command will return a process number if SABnzbd is running. If it doesn't return anything, SABnzbd is not running.
Automatically restarting SABnzbd if it is not running
Cron jobs can be used to check if SABnzbd is running and start it up if it is not. There is a separate page on configuring cron jobs.
pkill -9 -fu "$(whoami)" 'SABnzbd.py' rm -rf ~/SABnzbd-* ~/.sabnzbd