I use the following script to backup the data area - adapted from someone else’s posting in the forums
I use cjmurph’s PMS As A Service to run Plex Media Server - so there are references to that service. I do not restart the service at the end because i follow this weekly script with a reboot and that would restart the service
Rem
set myRARAreaDrive=C:
set myRARArea=%LocalAppData%\Plex-Backups
set myPlexLocalPath=C:\Users\Plex\AppData\Local\Plex Media Server
if not exist "%LocalAppData%\Plex-Backups" mkdir "%LocalAppData%\Plex-Backups"
echo %date%,%time% - Creating LastBackup folder if it does not exist
if not exist "%LocalAppData%\Plex-Backups\Lastbackup" mkdir "%LocalAppData%\Plex-Backups\Lastbackup"
%myRARAreaDrive%
cd %LocalAppData%\Plex-Backups
Rem
Rem
rem backup last backup RAR file first (keep one older version)
echo %date%,%time% - Moving last backup files
move /Y *.rar %myRARArea%\Lastbackup\
move /Y *.log %myRARArea%\Lastbackup\
Rem
echo %date%,%time% - Stopping PlexService Service
%windir%\system32
net stop PlexService
echo %date%,%time% - Force Terminate Plex processes
%windir%\system32 askkill /im "Plex Media Scanner.exe" /t /f > nul
%windir%\system32 askkill /im PlexScriptHost.exe /t /f > nul
%windir%\system32 askkill /im PlexDlnaServer.exe /t /f > nul
%windir%\system32 askkill /im "Plex Media Server.exe" /t /f > nul
echo %date%,%time% - Running WinRar for All Data in %MyPlexLocalPath%
"C:\Program Files\WinRAR\rar.exe" a -r -y -dh -v1000000 -inul -logf=rarList.log PlexLocalData.rar "%MyPlexLocalPath%\*.*"
Rem Not restarting Service - reboot will do it. %windir%\system32
net start PlexService
echo %date%,%time% - Exiting
Rem
Should really also add kill for PlexNewTranscoder.exe and PlexTranscoder.exe processes as well
This version is a variation and covers an earlier version of PMS As A Service
Ought to add export of registry but have not done it because I run this in admin account which is different from the Plex Media Server windows account and I need to find out the Account SID in the registry before I can back it up. Would be easier probably just to backup the whole HKEY_USERS set