10 lines
363 B
Bash
Executable File
10 lines
363 B
Bash
Executable File
#!/bin/sh
|
|
# set -euo pipefail
|
|
|
|
# this should live in /mnt/media/plexsync
|
|
|
|
FILENAME="plexdb_term_$(date -u +%FT%T).sqlite"
|
|
sqlite3 /config/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db ".backup /mnt/media/plexsync/$FILENAME"
|
|
|
|
ls -tp /mnt/media/plexsync/plexdb_15min* | tail -n +5 | xargs -I {} rm -- {}
|