Skip to content

Instantly share code, notes, and snippets.

View bcurran3's full-sized avatar

bcurran3 bcurran3

View GitHub Profile
@Deathproof76
Deathproof76 / plexdb_healthcheck.sh
Created June 28, 2023 11:30
Crontab restart/repair script for Plex "Sqlite3: Sleeping for 200ms to retry busy DB"
#!/bin/bash
# Function to check the health of the plex container
check_plex_health() {
# Get the last 10 lines of log output from the plex container
plex_logs=$(docker logs --tail 10 plex)
# Count the number of times the "Sqlite3: Sleeping for 200ms to retry busy DB" line appears in the logs
count=$(grep -c "Sqlite3: Sleeping for 200ms to retry busy DB" <<< "$plex_logs")