This should be written in docs that scanner is user sensitive
Still id does not adress the issue how to create the script that can be run from my user session in terminal to refresh library
May I direct you to the tag server-linux-tips where I show how to interact with the API.
Most of the Plex API is closed and only to be used through the GUI. This is how Engineering created it.
PMS is designed for home use, not for commercial use where scripting is common practice.
Further, When configured correctly, the addition or removal of media is detected automatically. There is no need to force a scan manually.
Caveat, your flavor of Linux (mine is Ubuntu) will likely have a different directory structure for LD configuration. See: man ldconfig for the specifics for your flavor of Linux as to why this is probably a bad idea.
Please don’t do this. This could cause havoc as other software might start to use libraries bundled with PMS and not the normal libraries of the system. There is a reason, Plex does not just also add this configuration.
Thank you for pointing this out. Now I know why I started running into this error stack each time I mistyped a command after making that change :
$ asdf
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in <module>
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 3, in <module>
import sqlite3
File "/usr/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: /usr/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-x86_64-linux-gnu.so: undefined symbol: sqlite3_transfer_bindings