mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-12-05 08:52:31 -05:00
Improve database backup selection logic, Add BINHEX support
Added informative output and correct issue selecting final available backup. Added binhex (Arch) docker support Updated READMEmd Add support for all Docker variants Change detection to use cgroup Add BINHEX support, Update README.md
This commit is contained in:
35
DBRepair.sh
35
DBRepair.sh
@@ -396,8 +396,8 @@ HostConfig() {
|
||||
return 0
|
||||
|
||||
|
||||
# Docker
|
||||
elif [ -f /bin/s6-svscan ] && [ -d "/config/Library/Application Support" ]; then
|
||||
# Docker (All main docker variants except binhex)
|
||||
elif [ "$(grep docker /proc/1/cgroup | wc -l)" -gt 0 ] && [ -d "/config/Library/Application Support" ]; then
|
||||
|
||||
PLEX_SQLITE="/usr/lib/plexmediaserver/Plex SQLite"
|
||||
AppSuppDir="/config/Library/Application Support"
|
||||
@@ -409,6 +409,19 @@ HostConfig() {
|
||||
HostType="Docker"
|
||||
return 0
|
||||
|
||||
# BINHEX Plex container
|
||||
elif [ "$(grep docker /proc/1/cgroup | wc -l)" -gt 0 ] && [ -d "/config/Plex Media Server" ]; then
|
||||
|
||||
PLEX_SQLITE="/usr/lib/plexmediaserver/Plex SQLite"
|
||||
AppSuppDir="/config"
|
||||
PID_FILE="$AppSuppDir/Plex Media Server/plexmediaserver.pid"
|
||||
DBDIR="$AppSuppDir/Plex Media Server/Plug-in Support/Databases"
|
||||
LOGFILE="$DBDIR/DBRepair.log"
|
||||
LOG_TOOL="logger"
|
||||
|
||||
HostType="BINHEX"
|
||||
return 0
|
||||
|
||||
# Western Digital (OS5)
|
||||
elif [ -f /etc/system.conf ] && [ -d /mnt/HD/HD_a2/Nas_Prog/plexmediaserver ] && \
|
||||
grep "Western Digital Corp" /etc/system.conf >/dev/null; then
|
||||
@@ -959,14 +972,16 @@ do
|
||||
Output "Checking for a usable backup."
|
||||
Candidate=""
|
||||
|
||||
Output "Database backups available are: $Dates"
|
||||
for i in $Dates
|
||||
do
|
||||
|
||||
# Check candidate
|
||||
if [ -e $CPPL.db-$i ] && \
|
||||
[ -e $CPPL.blobs.db-$i ] && \
|
||||
CheckDB $CPPL.db-$i && \
|
||||
CheckDB $CPPL.blobs.db-$i ; then
|
||||
if [ -e $CPPL.db-$i ] && \
|
||||
[ -e $CPPL.blobs.db-$i ] && \
|
||||
Output "Checking database $i" && \
|
||||
CheckDB $CPPL.db-$i && \
|
||||
CheckDB $CPPL.blobs.db-$i ; then
|
||||
|
||||
Output "Found valid database backup date: $i"
|
||||
Candidate=$i
|
||||
@@ -1052,11 +1067,11 @@ do
|
||||
WriteLog "Replace - Verify databases - FAIL"
|
||||
Fail=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If successful, save
|
||||
[ $Fail -eq 0 ] && SetLast "Replace" "$TimeStamp"
|
||||
break
|
||||
# If successful, save
|
||||
[ $Fail -eq 0 ] && SetLast "Replace" "$TimeStamp"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user