12 lines
491 B
Bash
Executable File
12 lines
491 B
Bash
Executable File
#!/bin/sh
|
|
|
|
FILENAME="plexdb_15min_$(date -u +%FT%T).sqlite"
|
|
|
|
echo "Starting 15 minute backup of Plex Database."
|
|
if sqlite3 /config/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db ".backup /mnt/media/plexsync/$FILENAME"; then
|
|
echo "15 minute backup of Plex database is complete."
|
|
find /mnt/media/plexsync -name "plexdb_15*" | tail -n +5 | xargs -I {} rm -- {}
|
|
else
|
|
echo "15 minute backup of Plex database has failed."
|
|
fi
|