Hi, apologies - I did mean to respond to this thread when I got things working. Yes, I took the UnionFS route and it works very well so far. Here’s the outline of the process from system boot:
-
Mount the acd_cli ACD drive using the init.d script from the project’s Github. I think for me that script only ran when a user actually logged in, so I had to modify it to run as root following this - https://github.com/yadayada/acd_cli/issues/264
-
Created a folder called “Media-local” which is my local “cached” version of my Media folder. You’ll see why in next step. My “Download” folder is also local.
-
I then use crontab to mount the UnionFS-FUSE drive. I think the “correct” way to do this is to use fstab, but on my VPS modifying that caused the whole system to fail to boot. Therefore, I use this crontab line:
@reboot sleep 20 && /usr/local/bin/unionfsmount
This waits 20 seconds after boot (to make sure ACD has mounted) and then pulls this script:
/usr/bin/unionfs-fuse -o cow,allow_other /home/fozz/Media-local=RW:/home/fozz/ACD/Media=RO /home/fozz/Media
That creates one “/home/fozz/Media” folder for ACD and the “Media-local” version. For clarity, the script above will really put all files copied to “/home/fozz/Media” into “/home/fozz/Media-local”. However, the contents of “Media-local” and “ACD” will appear as one unified “Media” folder from Sonarr / Plex / CP point of view.
-
Configure Sonarr to use “/home/fozz/Media” as it’s Media folder.
-
When downloads are complete Sonarr will put them in a nice chain of folders, via UnionFS, in “Media-local”. Sonarr will see them with all other episodes on ACD through the magic of UnionFS.
-
Now, I need to get those local files up to ACD. For that, I use an rclone script called via Settings → Connect in Sonarr whenever a download / upgrade is complete. My rclone script just does this:
rclone move /home/fozz/Media-local/TV ACD:/Media/TV --exclude .@**
rclone move /home/fozz/Media-local/Movies ACD:/Media/Movies --exclude .@**
acd_cli sync
The act_cli sync command is there to force refresh the ACD FUSE mount. Because we’re using move rclone will delete the “Media-local” version, but the change will be invisible to Plex / Sonarr.
Hope this is some help, although I’ve probably missed some steps. I personally prefer rclone to acd_cli, but the FUSE implementation on the former is still experimental hence the mash-up.
I appreciate that this looks very amateurish! I’m not a programmer! I’m not claiming any of the above is the “best” way to set this up, but I first tried using Linux a month ago and it’s the best I can do! I’m sure others can improve.