Moving folders to SSD, question

This is what I’m doing now :slight_smile:
tar cf - ./Library | pv | (cd /mnt/plexdata ; tar -xpf -)

Luckily I had already moved the Cache, Metadata and Database folders, so the only HUGE folder will be Media/localhost.

If I may pose another question, what is the purpose behind the “cache” folder?
Does it present art/thumbs here prior to moving it into the Metadata folder?

I’m a bit confused as to why there are both, unless it’s an intermediate “holding area” for newly processed art. Or perhaps it’s an area where art/thumbs are moved to avoid traversing the entire Metadata folder?

Just curious now :slight_smile:

To my knowledge;

  1. Cache is just that… the intermediate versions of posters / images PMS needs to display in the apps
  2. The source of that cache comes from the Media & Metadata directories.

I could be wrong but whenever I purge the Cache, it keeps on trucking.
If i empty the Media or Metadata directories – bad things happen :rofl:

“bad things happen” - the creedo of most IT pros, lol!

Yeah I was just curious as to it’s “role” in the hierarchy of when thumbs/art is placed where. Perhaps it’s that concatenation of the data in Media & Metadata that prevents lookups to two locations and instead points to a unified presentation of data. That makes sense to me.

I really want to thank you for bearing with what must be inane questions. I promise you I’m actually quite literate when it comes to tech, but I’m also competent enough to be wary :wink:

I’ve been doing this for “a while” and still generate my fair share of FUBAR events.
There really is nothing as exciting as testing on “Production”! :rofl:

Live data manipulation for the win!! lol
Yeah, sandboxing is for wimps and, you know, people who read instruction manuals, hahaha!

In a world full of “push-button-make-rocket-go” people, be a command line jockey :slight_smile:

Instruction Manual? What’s that? :thinking:

See? Now I know you’re *good people.

*reckless, adventurous, instant-gratification, “let’s do this!”

Go read the shell script which is the Debian installer

:rofl: :rofl: :rofl:

Can’t be more of a hack than my “automated” update script:
#!/bin/sh
wget -O newplex.deb “https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=debian&X-Plex-Token=XXXXXXXXXXXXXXXXXXX
sudo systemctl stop plexmediaserver stop && sudo dpkg -i newplex.deb && sudo systemctl start plexmediaserver && rm newplex.deb

It’s fugly, but it works. I have it combined with a PHP script that can push this command into the “at” scheduler if I want to perform an immediate update or planned maintenance.

“Push button make Plex GO!” lol

I specialize in “Elegant Hacks”, TYVM :stuck_out_tongue:

"Push button, watch go :boom: "

Me too!
I’m not the greatest coder but I have good, practical ideas that work.
Real coders would laugh at my syntax, but it works.

if it works – it’s real :smiling_imp:

Exactly - thank you for validating my ineptitude, lol.
Sorry for turning the forum into a chat thread - it’s just nice to speak to an intelligent person who can share their knowledge without talking down or ridicule :wink:

can you decode these? :smiling_imp:

# Extract value from Preferences.xml
# Return null string if not present
GetPref()
{

  Retval=""

  # This must remain as written with everything escaped for variables to work.
  # Do not attempt to extract unless exists in the file.

  if [ -e "$2" ]; then
    if [ "$(grep "$1" "$2" | wc -l)" -gt 0 ]; then
      Retval="$(grep -iPo \(\?\<=$1=\"\)\[\^\"\]\* "$2")"
    fi
  fi

  echo "$Retval"
}


# Extract Environment and Process variables from Configuration files
# Config files such as /etc/default/plexmediaserver and override.conf
#
# This function does not care which format is supplied
# Processing sequence is important
#
# Usage:
#   $1 = variable
#   $2 = file
GetValue()
{

  Retval=""

  Retval="$(grep -v '^#' "$2" | sed -e 's/^export //' | sed -e 's/^Environment=//' | \
            sed -e 's/^"//' | grep ^"$1" | head -1 | awk -F= '{print $2}' | tr -d '"' )"

  echo "$Retval"
}
#

I’m new to BASH (sed and awk frighten me as much as they exhilerate me).
It seems to a means to extract properly formatted variables from a file, where the file is passed as an argument to the script. The second checks to see if the supplied var in the supplied file exists as an ENV var?

The first one plucks the value out of Preferences.xml (as it states).

If you have TranscoderTempDir="/a/b/c", it will return /a/b/c

The second one is used to ingest local site configuration information.
I don’t care if init.d files or systemd files. It ingests and extracts the value , requested by name. (e.g. export User=chuck or Environment="TEMP_DIR=/a/b/c")

This is more my speed…

$query = "SELECT streamer.*, COUNT(fans.id) as fans FROM `streamer`,`fans` WHERE (streamer.`id` = fans.`artist`) AND (streamer.`is_streamer` = '1' AND streamer.`active` = '1' AND streamer.plan_level < 4) GROUP BY fans.artist ORDER BY streamer.`plan_level` DESC, streamer.`online` DESC, fans DESC, streamer.`realname` ASC";

Ahh, so that was your “patch” to workaround either init.d or systemd …
Cool!

Glad some knows databases.

Yes, that’s all my work.