[HOW TO] Install Recyclarr on TrueNAS Core

1ccs-todd

Dabbler
Joined
Aug 7, 2013
Messages
28
I found TRASH's Guides a few months back for fine-tuning the filters on sonarr/radarr.
Then I found TRASH's Recyclarr product for easily integrating this information.

Unfortunately this application requires Linux base which has been stripped from TrueNAS Core edition.
To overcome this hurdle, I setup a CentOS Virtual Machine configured to run the Recyclarr synchronization on start-up.
Then configured TrueNAS Cron Jobs to start/stop the VM daily.
Follow these steps to add this to your Servarr setup:

Go to https://www.centos.org/download/
Follow links to get CentOS-Minimal ISO.

Log into TrueNAS GUI.
GUI > Virtual Machines
Add a new VM.
configured for LINUX OS, 1 CPU, 2GB RAM, 20GB HDD with VNC support
Disable autoboot of VM.
Installation Media mapped to the downloaded ISO
Start VM to install CentOS.

Install OS. (add an additional user to WHEEL group if you want ssh access during setup/testing / or configure sshd for root login)
After installation, shutdown the VM and detach the CD ROM device, as it is no longer needed and usually causes VM to boot again from CD.
Once CD ROM is detached, start the VM again to setup Recyclarr.

open VNC window to VM
login as root.

Install prerequisites:
"yum install git wget linux_base-c7 libicu"
( git is used to clone TRASH's repo. the binary then uses this cloned info to update *arr via web API.)

Install Recyclarr binary:
"wget https://github.com/recyclarr/recyclarr/releases/latest/download/recyclarr-linux-x64.tar.xz"
"tar -xvf recyclarr-linux-x64.tar.xz"
"cp recyclarr /usr/bin/"
"rm recyclarr-linux-x64.tar.xz"
"rm recyclarr"

Create default Recyclarr configuraton files:
"recyclarr config create"

Use your favorite editor to edit default configuration (I prefer nano "yum install nano"):
"nano ~/.config/recyclarr/recyclarr.yml"
initial synchronization REQUIRES edit of base_url and api_key for both sonarr: and radarr: entries.
You can add additional trash_ids now or later to the recyclarr.yml file.
I will not cover additional trash_ids because these change by user preference and playback hardware.


Use your favorite editor to create start-up script: /etc/init.d/recyclarr.sh
Code:
#!/bin/bash
#
# recyclarr     This updates and runs recyclarr sync for radarr/sonarr
#
# chkconfig: - 30 50
# description: Syncs profiles to *arr
#
### BEGIN INIT INFO
# Provides:          recyclarr
# Description:       Recyclarr init script
### END INIT INFO

set -e

echo "Downloadeding latest release..."
wget https://github.com/recyclarr/recyclarr/releases/latest/download/recyclarr-linux-x64.tar.xz
tar -xf recyclarr-linux-x64.tar.xz
chmod u+rx recyclarr
echo "Successfully downloaded and extracted."

echo "Starting copy..."
cp recyclarr /usr/bin/

echo "Cleaning up..."
rm recyclarr-linux-x64.tar.xz
rm recyclarr
echo "Done."

echo "Updating  profiles..."
/usr/bin/recyclarr sync
echo "Done."

echo "All done successfully. Exiting."


Make sure script is runable:
"chmod +x /etc/init.d/recyclarr.sh"
"chkconfig --add recyclarr.sh"



This completes initial setup and configuration.
Run "/etc/init.d/recyclarr.sh", to test everything.
To test the init script, I restarted the VM.
Because the init script downloads the latest recyclarr binary, I could 'ls -al /usr/bin/recyclarr' and see the updated timestamp from VM startup.

Finally setup TrueNAS Cron Jobs to run the VM daily.
return to your TrueNAS GUI
First you need your new VM ID # from TrueNAS
TrueNAS GUI > Shell use command "midclt call vm.query | jq"
scroll through the results and find "ID": # for the new VM

TrueNAS GUI > Tasks > Cron Jobs
Add a new task to start the VM
Command: midclt call vm.start <VM#>
(change <VM#> to what you discovered in previous command)
Add a new task to stop the VM
Command: midclt call vm.stop <VM#>
set time for custom , daily, 5 minutes later than the start job

Final notes:
I have a secondary instance of radarr (radarr4k).
To update this, I copied the recyclarr.yml to radarr4k.yml and edited the copy url/api for my second instance and removed the sonarr references.
Then I edited the init script to additionally run "/usr/bin/recyclarr sync radarr -c ~/.config/recyclarr/radarr4k.yml"
 
Last edited:
Top