Plex Autoscan (by l3uddz) is a script that assists Plex with the adding media files, that were imported by Sonarr / Radarr, by only scanning the folder that has been imported (vs the entire section library folder), thereby preventing excessive cloud storage activity.
Plex Autoscan comes configured out of the box (as related to Saltbox). However, there a few things that need to be set by you.
For Plex Autoscan to work, at least one item needs to exist in each library before new items can show up.
If you already have media, simply add it to the library and do a manual scan within Plex, for each library you have, to build the DB.
If you currently don’t have any media, continue on with the setup, and when you have acquired some media, you will then perform a do a manual scan within Plex, for each library, to build the DB.
Note 1: The url will not use plex.domain.com if the IP address it points to does not match the server's IP address (e.g. Cloudflare CDN enabled).
Note 2: If the url is plex.domain.com, but you decide to enable Cloudflare proxy for the plex subdomain later, you will need to generate another Plex Autoscan URL and add that into Sonarr/Radarr/Lidarr instead, as the scan request will need to go to you server's actual IP and not a Cloudflare one.
Note 3: For Mediabox setups, make sure that the port is open in the firewall and/or router.
Note 4: The PAS URL is not meant to be accessed via a browser by default (i.e. going there will give you a 401 Unauthorized error). However, you can enable a web UI for manual scan requests, see here.
The following step is important so that Plex Autoscan can remove missing/replaced media files out of Plex (i.e. empty trash). Without it, Plex will be left with "unavailable" media that can't play (i.e. media posters with trash icons on them).
For more details on what the control file is, see here.
If you used the scripted rclone setup; these control files were created for you, and you can skip this step.
To upload the mounted.bin control file, run the following command:
rclonetouchgoogle:/mounted.bin
Note 1: If your Rclone remote config has a different name for your cloud storage remote, replace google: with yours.
Note 2: Above command requires Rclone version 1.39+.
Edit the control files in the Plex Autoscan config file¶
If you did step 4; you can skip this step.
On the server's shell, run the following command:
ls/mnt/remote/*.bin
To get the file names that you will need to enter into the Plex-autoscan config.
They'll look like: aarsqytesx-movies_mounted.bin, and in the default case there will be three of them.
To make this transparent to the user, saltbox installs a wrapper script that accounts for this. This means that you can run Plex Autoscan manually like this:
plex_autoscanCOMMAND
For example, if some documentation says you should run:
pythonscan.pysections
In saltbox you'd run:
plex_autoscansections
If this doesn't work for you, update saltbox and rerun the plex-autoscan role: