Skip to content

Instantly share code, notes, and snippets.

@EldonMcGuinness
Created February 24, 2024 00:56
Show Gist options
  • Save EldonMcGuinness/6c55659bd94c058fc071aa6bf02bae09 to your computer and use it in GitHub Desktop.
Save EldonMcGuinness/6c55659bd94c058fc071aa6bf02bae09 to your computer and use it in GitHub Desktop.
Backup Plex
#!/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