DBRepair development

Thanks, sounds like my estimate of every few months was about right. Guess it really depends on the amount of content added so thanks for confirming that,

I did see that suggestion from TeknoJunky. Makes sense especially if going forward this would become a somewhat semi regular maintenance tasks for server admins.

That certainly makes a lot of sense.

BTW… wonder if its worth adding the version info (v0.6.1) to the top of the script to match the release in git ? Within here …

#########################################################################
# Plex Media Server database check and repair utility script.           #
# Maintainer: ChuckPa                                                   #
#########################################################################

That way when we have a local copy of the script we can quickly know if there is a later version. Just a suggestion …

1 Like

I’ll include that in the next release

2 Likes

@ChuckPa Hey, so I was working with you a few weeks ago to get this script working in unraid with Binhex plex. I used THIS script in the past. It’s a collection of scripts to do various things if you use the binhex template.

Do you mind taking a peek at it and telling me if it does what your script does?

If you go look,

  1. cgroups v2 has been added
  2. binhex has been added

From what i see on that page you linked, that looks more like a PMS-function tool.

I work at the database only (SQLite level).
I don’t do anything with the internal contents.

1 Like

Oh good news! Is it all baked into the master release? GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases

Do you place tar in the hidden docker folder? Or the appdata folder? (I’m on Unraid, if that matters which doesnt expose the docker folder, just the appdata folder.

@Sittingmongoose

You place the tarball in whichever directory /config points to .

This way, when you open the container,

cd /config
tar xf PlexDBRepair-xxxxxxx.tar.gz

... etc...

Forgive my ignorance, I am having a hard time actually getting to the /config folder of my Hotio plex image on Unraid. I got this far.


But I haven’t been able to access that folder to actually put the Tar file in it.

If you can’t put it in your /config, try putting it at the top of one of your media directories

Once you get into the container, you can move it to wherever you want.

When I create containers, I specify where I want /config stored in the file system.
Docker can create its screwy UUIDs but I want easy access to /config which is also persistent between container instances.

My /config is set to /mnt/cache/appdata/plex/ However I think this is different from the config folder you’re looking for.

Stop. :slight_smile:

you missed a few steps.

  1. Copy the file to where /config is in your file system :white_check_mark:
  2. Enter the container (docker exec -it plex bash) - :frowning:
  3. Stop Plex - :frowning:
  4. cd /config :white_check_mark:
  5. ./DBRepair.sh :white_check_mark:

The tool only runs in the namespace of where PMS runs.

  • If PMS is native to the host, run the tool on the host (inside the host OS)
  • If PMS is installed in a container, run the tool inside the same container.

I am getting close!! The only thing I cant figure out is how to kill plex. My normal methods kill the bash into the docker. And the command on your git is producing weird results.
image

Check your quotes there.

When you see > , you have a dangling quote

you can also kill -15 $(pidof Plex\ Media\ Server)

-or-

ps -ef | grep -i plex

find Plex Media Server

kill -15  PID

So it seems like it kills it for a few seconds and then it comes right back.

Using kill -15 $(pidof Plex\ Media\ Server), resulted in > again.

@Sittingmongoose

See the s6-supervise ? You’ll have to shut down the service.

As I show in the README on Github

To launch in a Docker container:
        sudo docker exec -it plex /bin/bash

        # Stop Plex when using official Plex,inc image
        /plex_service.sh -d
--or--
        # Stop Plex when using Linuxserver.io Plex image
        s6-svc -d /var/run/service/svc-plex
--or--
        # Stop Plex in binhex containers
        kill -15 $(pidof 'Plex Media Server')



        tar xf PlexDBRepair-0.6.1.tar.gz
        cd PlexDBRepair-0.6.1
        chmod +x DBRepair.sh
        ./DBRepair.sh

Looks like you need to use s6-svc

Killing the s6 process did the same. Came right back.

Again I’m sorry for my lack of capability here.

@Sittingmongoose

whose image are you attempting to use ?

what does ls -la / /var/run/service return?

Hotio on UnRAID

Here you go.

  1. I am completely unable to get unraid to boot in an ESXi VM (their trial)

  2. I cannot help with that image without finding the Plex control

  3. You need to ask them how to do it.

Maybe, from inside the container

  find / -name \*plex\*

If you find a start script, it’ll give clues how to stop it.

So I have a friend helping me, got the service to die, but realized I wrote Binhex to you and not Hotio. I am using Hotio which has a very different folder structure.

Extending the tool to support Hotio isn’t difficult if the folder structure is known.

If you’ll share with me what you find, I’ll add it