From 74a6a1774d6d65a8d817a126e9c4d8dd6f0b43fd Mon Sep 17 00:00:00 2001 From: Tyler Date: Wed, 30 Sep 2020 17:54:53 -0500 Subject: [PATCH] change ownership of lifecycle backups --- backupscripts/restore | 1 + backupscripts/term_backup | 1 + 2 files changed, 2 insertions(+) diff --git a/backupscripts/restore b/backupscripts/restore index 97ef8b5..51cbf14 100755 --- a/backupscripts/restore +++ b/backupscripts/restore @@ -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." diff --git a/backupscripts/term_backup b/backupscripts/term_backup index 7a9391b..5961b38 100755 --- a/backupscripts/term_backup +++ b/backupscripts/term_backup @@ -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