Running media refresh using commandline (plexmediaserver-plexpass-




How do I refresh my library (specifically movies and tv-series) using "Plex Media Scanner" from the command line on plexmediaserver-plexpass- and fbsd11.1-p2?

I've tried something along the lines of sudo -u plex HOME="/usr/local/plexdata/Plex Media Server" LD_LIBRARY_PATH=/usr/local/lib/compat:/usr/local/share/plexmediaserver-plexpass FFMPEG_EXTERNAL_LIBS="/usr/local/plexdata/Plex Media Server/Codecs/c9ea179-1157-freebsd-x86_64", but running the command /usr/local/share/plexmediaserver-plexpass/Plex\ Media\ Scanner --list does not produce any output, telling me I'm missing some important detail :-).

And is it an easier way to run the plex binaries from the command line than what I've tried?

Thank you in advance for all help on this.


Nobody knows how to actually run plex binaries on the command line? :-)


I think you need a few env vars (probably looking into the rc script would help), in any case if you simply want to refresh you're movies and tv shows you can just use an API call like:

IP:32400/library/sections/all/refresh?X-Plex-Token=xxxxx FOR all or IP:32400/library/sections/ID/refresh?X-Plex-Token=xxxxx

ID = the library id which you can get from the IP:32400/library/sections/endpoint

Use curl or any preferred tool for that (I prefer httpie) so I.E:

http "http://LAN_IP:32400/library/sections/all/refresh" X-Plex-Token:YOUR_TOKEN

or if you have Secure Connection only enabled make the call using the FQDN url:
http --json X-Plex-Token:YOUR_TOKEN

Does that help?