Help running Plex Media Scanner from command line on Synology DS918+

Can anyone provide me the step-by-step commands to run Plex Media Scanner from Putty on my Synology DS918+ PMS? I’ve successfully connected to the server via Putty, but need help with the rest of the commands.

I found this article, but it doesn’t give step-by-step commands for a Synology (assuming its Linux)…
https://support.plex.tv/articles/201242707-plex-media-scanner-via-command-line/?_ga=2.43672423.336530657.1534291148-2032550310.1483934697

I ran these commands that I found in another post, but I believe I’m missing a step or probably dont have the correct syntax…

admin@ds918:/$ cd “/volume1/@appstore/Plex Media Server/”
admin@ds918:/volume1/@appstore/Plex Media Server$ ./Plex\ Media\ Scanner -i
./Plex Media Scanner: error while loading shared libraries: libboost_atomic.so.1.59.0: cannot open shared object file: No such file or directory
admin@ds918:/volume1/@appstore/Plex Media Server$ export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
admin@ds918:/volume1/@appstore/Plex Media Server$ ./Plex\ Media\ Scanner -l
./Plex Media Scanner: error while loading shared libraries: libboost_atomic.so.1.59.0: cannot open shared object file: No such file or directory

Thanks @trumpy81, that got me further than before. But I’m still not doing something right after that. Can you help me get the ‘List’ function to work? Here’s what I tried…

admin@ds918:/$ sudo -su root
sh-4.3# cd ‘/volume1/@appstore/Plex Media Server’
sh-4.3# export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
sh-4.3# ./Plex\ Media\ Scanner -l
./Plex Media Scanner: error while loading shared libraries: libboost_atomic.so.1.59.0: cannot open shared object file: No such file or directory
sh-4.3#

@dubdrive

Here is a script you can call, su plex -s bin/sh -c /path/to/script.sh
Amend as appropriate

#!/bin/sh
export LD_LIBRARY_PATH="/var/packages/Plex Media Server/target"
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/volume1/Plex/Library/Application Support"

"/var/packages/Plex Media Server/Plex Media Scanner"  ---your command options or `$1-` here---
1 Like

Thanks @ChuckPa. Forgive my ignorance, I still can’t get the ‘List’ function to work, I’m probably missing something really basic since I’m not experienced with linux commands…

admin@ds918:/$ sudo -su root
Password:
sh-4.3# cd ‘/volume1/@appstore/Plex Media Server’
sh-4.3# #!/bin/sh
sh-4.3# export LD_LIBRARY_PATH="/var/packages/Plex Media Server/target"
sh-4.3# export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/volume1/Plex/Library/Application Support"
sh-4.3# “/var/packages/Plex Media Server/Plex Media Scanner” --list
sh: /var/packages/Plex Media Server/Plex Media Scanner: No such file or directory

Not sure what to do with the script you mentioned, but this is what I got when I ran that command…
sh-4.3# su plex -s bin/sh -c /path/to/script.sh
su: failed to execute bin/sh: No such file or directory

Please advise, and thanks again.

It is username sensitive, as I wrote. plex, not root
and you forgot the target directory in the path

apologies. Hour very late here su plex -s /bin/sh ........ (all linux pathnames begin with /)

Thanks @trumpy81 and @ChuckPa. Please bear with me as I’m still lost. I’m guessing the script part of @ChuckPa 's suggestion isn’t required just to run the scanner list command, so I’m going to set that aside for now (correct me if I’m wrong).

How do I get the following command to work with the right syntax? do I need to replace the “/var/” part in the command with another folder path? How do I find that folder path?

sh-4.3# “/var/packages/Plex Media Server/Plex Media Scanner” --list
sh: /var/packages/Plex Media Server/Plex Media Scanner: No such file or directory

Thanks!

P.S. I should also mention that I’ve run the scanner list command on a Windows PMS server before, so thats my background. But I’m now running PMS on Syno as you can tell, rather than Windows. But here’s how I used to run the command on windows, and this is all I’m trying to do on the Syno ds918+:

C:\Users\user1>“C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” --list
1: Movies
5: Photos
4: TV
6: Vault

TYPO on my part:

Do you see it?

  1. The LD_LIBRARY_PATH value is correct.
  2. The directory for the executable is missing the target directory.

"/var/packages/Plex Media Server/target/Plex Media Scanner"

If you are going to play at this level, please to try to be a bit more self sufficient?
It’s not for the 'blind scripter".

@trumpy81 :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: (enough for the char min) LOL

Good pointer. For those needing similar help, here’s how it worked for me…

admin@ds918:/$ sudo -su root
Password:
sh-4.3# #!/bin/sh
sh-4.3# export LD_LIBRARY_PATH="/var/packages/Plex Media Server/target"
sh-4.3# export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/volume1/Plex/Library/Application Support"
sh-4.3# “/var/packages/Plex Media Server/target/Plex Media Scanner” --list
/var/packages/Plex Media Server/target/Plex Media Scanner: /lib/libstdc++.so.6: no version information available (required by /var/packages/Plex Media Server/target/libgnsdk_dsp.so.3.07.7)
/var/packages/Plex Media Server/target/Plex Media Scanner: /lib/libstdc++.so.6: no version information available (required by /var/packages/Plex Media Server/target/libgnsdk_dsp.so.3.07.7)
/var/packages/Plex Media Server/target/Plex Media Scanner: /lib/libstdc++.so.6: no version information available (required by /var/packages/Plex Media Server/target/libgnsdk_fp.so.3.07.7)
/var/packages/Plex Media Server/target/Plex Media Scanner: /lib/libstdc++.so.6: no version information available (required by /var/packages/Plex Media Server/target/libgnsdk_fp.so.3.07.7)
1: Movies
5: Photos
4: TV
6: Vault

Not sure why it complains about the version, but it returns the List nonetheless.

Synology strips the version and symbol information from the runtime libraries .

The error is harmless.

Be advised, If you cause it to start operations (other than just reading) as root, you will create a file ownership conflict within PMS which will require manual intervention to correct.

Ok, good to know. Does that include the scanners “–index” action to generate media index files?

Yes. The index files will be generated as user root and not user plex.

This is why I expressly show su plex to launch as user plex.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.