DBRepair development

Folks,

I’m going to take a plunge, drive a stake into the ground and offer “v1.0.0 BETA 1” for your consideration.

I do this because it feels mature at this level of development

I am bumping to 1.0 because most of the code has been rewritten (consistent with software development rules about bumping major version number)

Documentation is coming along. The README is still rough but new content is better structured.

I expect cosmetic tweaks here and there.

I also expect tweaking docker container start/stop features. Please let me know/

Host Supported:

  1. Apple (MacOS)
  2. ASUSTOR
  3. Docker containers via ‘docker exec’ command (inside the running container environment)
    – Plex,inc.
    - Linuxserver.io
    - BINHEX
    - HOTIO
    - Podman (libgpod)
  4. Linux workstation & server
  5. Netgear (OS5 Linux-based systems)
  6. QNAP (QTS & QuTS)
  7. Synology (DSM 6 & DSM 7)
  8. Western Digital (OS5)

The menu

For clarity, each command’s name is ‘quoted’.

      Plex Media Server Database Repair Utility (_HostType_)
                       Version v1.0.0

  Select

      1 - 'stop' PMS (if available)
      2 - 'automatic' database check, repair/optimize, and reindex in one step.
      3 - 'check' database
      4 - 'vacuum' database
      5 - 'repair' / 'optimize' database
      6 - 'reindex' database
      7 - 'start' PMS (if available)
      8 - 'import' viewstate (Watch history) from another PMS database
      9 - 'replace' current database with newest usable backup copy (interactive)
     10 - 'show' logfile
     11 - 'status' of PMS (Stop/Run and databases)
     12 - 'undo' - Undo last successful command

     99 -  exit

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

Use of Command Name is recommended. Command numbers will change as new capabilities are added.

Recommended usage:

sudo bash
./DBRepair.sh  stop auto status start exit
  1. Stop PMS
  2. Perform automatic maintenance
  3. Show status (PMS and DBs)
  4. Start PMS
  5. Exit

Internal changes

  1. Inline code restructured to functions
  2. New command line parser
  3. Each database operation now guarantees ample free space exists prior to starting.
  4. Each command checks PMS run-state prior to beginning (PMS might have restarted)
  5. Log file date-time stamp improved
  6. Scripted mode shows date/time stamp as each command executes

Sample session

bash-4.4# ./DBRepair.sh stop check vacuum reindex start exit
 
 
 
      Plex Media Server Database Repair Utility (Synology (DSM 7))
                       Version v1.0.0
 
 
[03.11.55] Stopping PMS.
[03.11.55] Stopped PMS.
 
[03.11.55] Checking the PMS databases
[03.13.30] Check complete.  PMS main database is OK.
[03.13.31] Check complete.  PMS blobs database is OK.
 
[03.13.31] Backing up databases
[03.13.31] Backup current databases with '-BKUP-2023-02-25_03.13.31' timestamp.
[03.13.38] Vacuuming main database
[03.14.31] Vacuuming main database successful (Size: 398MB/398MB).
[03.14.31] Vacuuming blobs database
[03.14.32] Vacuuming blobs database successful (Size: 1MB/1MB).
[03.14.32] Vacuum complete.
 
[03.14.33] Checking the PMS databases
[03.15.25] Check complete.  PMS main database is OK.
[03.15.25] Check complete.  PMS blobs database is OK.
[03.15.25] Backing up of databases
[03.15.25] Backup current databases with '-BKUP-2023-02-25_03.14.32' timestamp.
[03.15.30] Reindexing main database
[03.16.15] Reindexing main database successful.
[03.16.15] Reindexing blobs database
[03.16.15] Reindexing blobs database successful.
[03.16.15] Reindex complete.
 
[03.16.15] Starting PMS.
[03.16.29] Started PMS
 
bash-4.4# 
4 Likes