SHARE
TWEET

Plex Backup

MrGold Jul 14th, 2019 291 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Backup = "I:\BACKUP_PLEX"
  2.  
  3. $Plex_Dir = "$env:LOCALAPPDATA\Plex Media Server"
  4. $Plex_Reg = "HKCU\Software\Plex, Inc.\Plex Media Server"
  5.  
  6. $7zexe = 'C:\Program Files\7-Zip-CLI\x64\7za.exe'
  7.  
  8. taskkill /f /im "Plex Media Server.exe" /t
  9.  
  10. reg export $Plex_Reg  "$Plex_Dir\Plex.reg"
  11.  
  12. $7zcmd = @(
  13.     'a'
  14.     '-t7z'
  15.     "$Backup\plex.7z"
  16.     $Plex_Dir
  17.     '-mx0'
  18.     '-xr!Plex Media Server\Diagnostics'
  19.     '-xr!Plex Media Server\Scanners'
  20.     '-xr!Plex Media Server\Crash Reports'
  21.     '-xr!Plex Media Server\Updates'
  22.     '-xr!Plex Media Server\Logs'
  23.     '-v1g'
  24. )
  25.  
  26. & $7zexe $7zcmd
  27.  
  28. Remove-Item "$Plex_Dir\Plex.reg"
  29.  
  30. Start-Process "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top