Created
February 24, 2024 00:56
-
-
Save EldonMcGuinness/6c55659bd94c058fc071aa6bf02bae09 to your computer and use it in GitHub Desktop.
Backup Plex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ALL=false | |
DB=false | |
if [ -z $1 ]; then | |
exit | |
fi | |
if [ -z $2 ]; then | |
ALL=true | |
elif [ $2 == 'all' ]; then | |
ALL=true | |
elif [ $2 == 'db' ]; then | |
DB=true | |
fi | |
if [ $ALL == true ]; then | |
tar -cvf $1 --exclude '*/Cache' --exclude '*/Crash Reports' --exclude '*/Logs' --exclude '*/Updates' --exclude '*/Plug-in Support/Databases' /var/lib/plexmediaserver | |
elif [ $DB == true ]; then | |
tar -cvf $1 /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment