forked from HawksRepos/PTS-Team
-
Notifications
You must be signed in to change notification settings - Fork 55
Plex Plugin DB Backup
PhysK edited this page Jan 22, 2020
·
1 revision
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
Wiki - Wiki
- Recommended Pre-Reading
- Server - Storage Planning
- Usenet or BitTorrent
- PTS Editions
- PTS Folder Structure
- PTS-Repos
- Common Issues
Data Transport
- Traefik
- Port Guard
- PTS Shield
- PTS Press
- Google Cloud - GCE
- Hetzner Cloud
- PTS Fork
- Extra PTS Commands
- PTS Vault - Data Storage
- PTSPatrol
- Plex AutoScan in Docker Container
- Plex_Dupefiner
- Traktarr
- System & Network Auditor
- PreInstaller & UnInstaller
Core Apps [Expand]
Community Apps [Expand]
- AirSonic
- Bazarr
- Bitwarden
- BookSonic
- cAdvisor
- Cloud Commander
- Deluge
- DelugeVPN
- Dozzle
- Duplicati
- Filebrowser
- FlexGet
- Gazee
- Headphones
- Heimdall
- HomeAssistant
- jd2-openvpn
- Kitana
- Logarr
- MakeMKV
- MariaDB
- McMyadmin
- MEDUSA
- Mellow
- Miniflux
- Monitorr
- Muximux
- Mylar
- NextCloud
- NowShowing
- NZBHydra2
- Organizr
- plpp
- pyLoad
- qBittorrent
- QBittorrent VPN
- radarrsyncarr
- Resilio
- rflood-openvpn
- rutorrent-openvpn
- Shoko Anime Server
- SpeedTest
- SyncLounge
- Teamspeak3
- The Lounge
- Transmission
- Trakt.or
- Ubooquity
- Varken
- vnc-xfce
- vnstat
- ZeroTier