-
Notifications
You must be signed in to change notification settings - Fork 255
Plex Plugin DB Backup
proelior edited this page May 5, 2019
·
4 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
In this script, the directory * Plug-in Support * including all other data is uploaded daily as backup to your GDrive. These backups are saved as * tar-gz, so if something happens you can quickly replace the data.
tree -u -L 1 /opt/appdata/plex/database/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/
/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/
├── [XXXXXXX] Caches
├── [XXXXXXX] Data
├── [XXXXXXX] Databases
├── [XXXXXXX] Metadata Combination
└── [XXXXXXX] Preferences
- su > to root
- cd /opt/appdata/plex/
- mkdir script
- chown -cR 1000:1000 /opt/appdata/plex/script
- cd /opt/appdata/plex/script
- nano plexbackup.sh * add the lines below [plexbackup.sh]
- CTRL + X
- chmod a+x plexbackup.sh
- paste this line
sudo sed -i '$a\@daily bash /opt/appdata/plex/script/plexbackup.sh >/dev/null 2>&1\' /var/spool/cron/crontabs/root
well done ;-)
#!/bin/bash
mkdir /mnt/gdrive/plexguide/plexdbbackups/
cp -arv /opt/appdata/plex/database/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/ /tmp/plex-backup/
cp -arv /opt/appdata/plex/script /tmp/plex-backup/
chown -cR 1000:1000 /tmp/plex-backup/
cd /tmp/
tar -cf plexdbbackup-"$(date '+%Y-%m-%d').tar.gz" plex-backup/
cp -arv plexdbbackup-"$(date '+%Y-%m-%d').tar.gz" /mnt/gdrive/plexguide/plexdbbackups/
rm /tmp/plexdbbackup-"$(date '+%Y-%m-%d').tar.gz"
rm -rv /tmp/plex-backup/*
exit 0
📂 Click Here - NZB's from USENET Server - PG Members Receive a 60% Discount
Home - https://plexguide.com