Is there another way to format the command?
echo .dump | "%PlexSQL%" "%PlexData%\com.plexapp.plugins.library.db"
can be
"%PlexSQL%" "%PlexData%\com.plexapp.plugins.library.db" .dump
REM System format controls ^Roll_eyes^
set TimeStamp=%date:~10,4%-%date:~+4,2%-%date:~+7,2%_%time:~0,2%.%time:~3,2%.%time:~6,2%
Looking at this again, it seems to me as if there is “Data” missing. My custom path is
\Plex\Data\Plex Media Server\Plug-in Support\Databases
Could that be it? I don’t know what the exact default path is these day…
EDIT: Scratch that. Andy’s other screenies show that it’s correct.
Gimme a sec…
work on that please.
Gotta run… late for Dr visit.
Replace this
set TimeStamp=%date:~10,4%-%date:~+4,2%-%date:~+7,2%_%time:~0,2%.%time:~3,2%.%time:~6,2%
with this…
REM ### Extract the Date and Time
SET DAY=%DATE:~0,2%
SET MONTH=%DATE:~3,2%
SET YEAR=%DATE:~6,4%
SET HOUR=%TIME:~0,2%
SET MIN=%TIME:~3,2%
SET SEC=%TIME:~6,2%REM ## Remove spaces from HOUR ##
SET HOUR=%HOUR: =%REM ## Set TimeStamp ##
SET TimeStamp=%YEAR%-%MONTH%-%DAY%_%HOUR%-%MIN%-%SEC%
And it then works…
Great job, but why would Chuck’s original script work for some and not for others?
That I cannot explain… It was all about resolving and manipulating the date and time variables.
All I can say is some machines behave differently to others!
What I have provided is something I have used in all my scripts for years, so I know it works.
I’m just making a backup of the DB’s on my main server and will try running it on that… That’s MS Server 2012R2.
Really interested to see if I get any performance gains as a result ![]()
12 vs 24 hour clock ??
24 hour clocks refer to 7 pm as ‘19’ hours.
we say (in German) ‘15 hours’ to denote 3pm.
Possible?
What happens when minutes or seconds are single digits?
Could very well be. I happen to be a German living in the US ![]()
Was born in the US (Gymnasium & Uni in Germany)
Superb, that’s fixed it. Thank you so much both of you
No worries ![]()
Windows batch scripting is kinda my thing.
Unfortunately I don’t seem to have seen any real improvement since running the script, but perhaps that because my libraries are not insanely large?
320 TV Series with approx 11,000 episodes.
1,100 movies
400 albums with approx 5,500 tracks
Try the searches. Those should jump up off the table at you.
How much memory in the machine? CPU and Disks fast enough?
Dumb question of the day:
Can one run the windows version on a downloaded db for a Linux based installation? And vice versa if I wanted to take advantage of the added options available in the Linux version? Or are the db structures different between the various os or maybe impacted by character issues?
Reason for asking is I have 2 Plex servers on remote Linux machines which I don’t think I have permission run a .sh on. What I was thinking of doing was dl and copying the db into a fresh windows install (similar to transferring to a new machine) running this and then replacing the old Linux db with the ones after this has been run.


