Skip to content

Plex fast BACKUP

benamira edited this page Mar 10, 2019 · 6 revisions

📂 Click Here - Sign up for Google's Suite for Business - Unlimited Space

📂 Click Here - NZB's with from NewsHost - PG Members Receive a 58% Discount




Table of Contents

  1. Intro
  2. Script


1. Intro

The purpose of this script is to do faster backups of plex database, by using all the CPU resources of the system. The backup is also sent to Google Drive.

In the script below, you just have to replace the variables with your custom paths.

The process is:

  1. Stop the Plex docker

  2. Create the backup and compressed file with tar + pigz

  3. Restart Plex Docker

  4. Send backup to Google Drive

  5. Remove local backup

2. Script

# autoplexbackup.sh 
# !/bin/bash

# Automatic Backup Plex and sync to Google Cloud Drive

# Variables
local_backups=/mnt/BACKUPS
remote=gdrive
remote_backups=BACKUPS

# Stop Plex
sudo docker stop plex
sleep 2s

# Backup Plex database
tar cf - "/opt/appdata/plex" -P | pigz > "$local_backups/$(date +%F-%R)-PlexBackup.tar.gz"
sleep 2s

# Restart Plex
sudo docker start plex
sleep 2s

# Send backup to Google Drive
rclone --config "/opt/appdata/plexguide/rclone.conf" copy "$local_backups" "$remote:$remote_backups"

# Remove local backup
rm -rv $local_backups/*

Installing PlexGuide

  1. PlexGuide Install Information

Preplanning & Information

  1. PG Folder Structure

Domain and Port Control

  1. CloudFlare Tunnel

Primary Applications

  1. Plex

Useful Links

  1. PG YouTube Channel

Clone this wiki locally