Fast, safe nightly mirror of the Plex data folder to a network share on Windows. Briefly quiesces Plex (stops Updater → stops Server), runs a tuned Robocopy mirror, then starts Plex (Server → Updater). Optimised for LAN/NAS targets and busy libraries.
Latest release: v1.0.0
- Find your service names (they vary):
Get-Service | ? DisplayName -like 'Plex*' | Select Name,DisplayName,Status # e.g. PlexService (server), PlexUpdateService (updater)
- Edit the top of
scripts/PlexData-Backup-Quiesced-MIN.cmd:set "SRC_LOCAL=G:\Plex Media Server" set "DEST=\\YOUR-NAS\backups\PlexData" set "PLEX_SVC_NAME=PlexService" set "PLEX_UPD_NAME=PlexUpdateService" set "THREADS=12"
- Dry-run once (no changes): set
DRYRUN=1in the file and run it. - Schedule nightly (Windows Task Scheduler):
- Run whether user is logged on or not
- Run with highest privileges
- Action:
cmd.exe /c "C:\Scripts\PlexData-Backup-Quiesced-MIN.cmd" - Start in:
C:\Scripts - Stop the task if it runs longer than 1 hour
- Robocopy:
/MIR /J /XJ /FFT /MT /R:1 /W:1(+ excludes for cache/codec/log noise) - Local source path (avoid SMB loopback), UNC destination
- Clean exit codes:
0/1= success;>=8= failure (good for schedulers/monitors)
- Service didn’t stop/start: use the service name (not the display name).
- Endless re-copies on NAS: keep
/FFT(2s timestamp tolerance). - Slow copies: avoid
/Z; add AV/Defender exclusions for SRC/DEST; on VMs use VMXNET3.
scripts/PlexData-Backup-Quiesced-MIN.cmd— main script (edit the Config block).docs/schtasks-example.md— Task Scheduler CLI example.docs/release-notes-v1.0.0.md— release notes for v1.0.0.docs/CHANGELOG.md— all notable changes.
License: MIT — use, tweak, share.