change ownership of lifecycle backups
This commit is contained in:
parent
8b0ea9884b
commit
74a6a1774d
|
|
@ -3,6 +3,7 @@
|
|||
FILENAME=$(ls -1t /mnt/media/plexsync/plexdb* | head -1)
|
||||
|
||||
if sqlite3 /config/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db ".restore $FILENAME"; then
|
||||
chown 1001:1001 "$FILENAME"
|
||||
echo "$(date)"": preStart lifecycle restore of Plex database was successful."
|
||||
else
|
||||
echo "$(date)"": preStart lifecycle restore of Plex database has failed."
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ FILENAME="plexdb_term_$(date -u +%FT%T).sqlite"
|
|||
|
||||
echo "$(date)"": Starting preStop lifecycle 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
|
||||
chown 1001:1001 "$FILENAME"
|
||||
echo "$(date)"": preStop lifecycle backup of Plex database is complete."
|
||||
find /mnt/media/plexsync -name "plexdb_term*" | tail -n +5 | xargs -I {} rm -- {}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue