QNAP: plex.sh update forum preview

Forum Preview:

This forum preview is being presented to confirm we have two major problems with QNAP control scripting now resolved.

  1. Nvidia GPU installed after Plex Media Server
    – The workaround was to restart PMS after QTS/QuTS boot completed.

  2. PlexData no longer worked as expected

In this preview

  1. PlexData will now work.
    – A more standard and much more reliable implementation method was found.
    – There won’t be any more corruption caused by moving around inside the directory tree
    – Backing up “Plex Media Server” will actually backup PMS instead of the link file.

  2. Plex.sh now looks at whether it was installed before or after the Nvidia GPU.
    – If installed before the Nvidia GPU, plex.sh will wait up to one minute for the Nvidia GPU to become ready (by QTS) before launching PMS.

Expectations.

  1. Confirm PlexData functional and more reliable
  2. Nvidia GPU startup works regardless whether before or after PMS installed.

All input is welcome.

As soon as we can reasonably confirm success, this update will be released in the next PMS version.

For your consideration:

plex-preview-1.tar (20 KB)

4 Likes

OK,

Stopped PMS, copied the script and restarted PMS.

Navigating around “Plex Media Server” is OK. So far, so good…

edit: I’m sure it doesn’t need to be said, but DBRepair.sh will need to be updated.

@JCHH

Script is placed as /share/*/.qpkg/PlexMediaServer/plex.sh ?

DBRepair.sh won’t need updating. It is not dependent on PlexData.

(( Please do try to make a backup of your “Plex Media Server” (or “tmp” ) directories in PlexData as confirmation you have the same results ))

Yes.

plex.test is yours (I reverted back to the original plex.sh).

When I put it in, I stopped Plex, changed the files (plex.sh ➜ plex.OK and plex-preview-1 ➜ plex.sh) and restarted Plex.

Coincidentally, I tried to use DBRepair and the ‘stop’ command wouldn’t work. When I put the original plex.sh back (restarted Plex), DBRepair’s ‘stop’ worked again.

I’ll do a backup next per your request and try DBRepair again - perhaps I’m just gang mad :rofl:

[edited for typos]

Hmmm. WTH? ‘stop’ is stop. (/etc/init.d/plex.sh stop)

There might be a problem with stop in Plex.sh UGH

What are you running?

Not sure what you mean by this? Plex rev?

@JCHH

Just checked now. DBRepair is ok on my TVS-1282.

[/share/Public] # chmod +x dbrepair.sh 
[/share/Public] # ./dbrepair.sh 
 
 
 
      Plex Media Server Database Repair Utility (QNAP)
                       Version v1.09.00
 

Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache and /tmp.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 99 - 'quit'      - Quit immediately.  Keep all temporary files.
      'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : stop
 
Stopping PMS.
Stopped PMS.

Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache and /tmp.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 99 - 'quit'      - Quit immediately.  Keep all temporary files.
      'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : status
 

Status report: Wed Nov 20 13:38:59 EST 2024
  PMS is stopped.
  Databases are not checked,  Status unknown.


Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache and /tmp.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 99 - 'quit'      - Quit immediately.  Keep all temporary files.
      'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : 
[/share/Public] # ps -ef | grep -i plex
21293 admin       908 S   grep -i plex
[/share/Public] # 

I’ll try again…

edit: It’s working now - not sure what happened before.

Could it have been a permissions thing? The first time I copied plex-preview-1.sh I didn’t set permissions. This time set it to 755 (I think it was 644).

sorry for the drama.

I’ll trying backing up next. Is there a recommended way to do it?

simplest thing to test:

Stop Plex

  1. Look in your ‘tmp’ folder, confirm there is stuff there.
  2. Backup the ‘tmp’ folder
  3. Empty the tmp folder
  4. Restore the tmp folder.

Should not be any issues

You can also be more destructive with ‘tmp’.

  1. Make backup of tmp
  2. Rename it
  3. Start Plex
  4. Stop Plex
  5. Observe tmp is back
  6. Now restore tmp

Yep, that all seemed to work OK for me (TS-664).

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