This commit is contained in:
2026-03-21 21:34:42 +00:00
parent 546686ac8c
commit a932232da7
5 changed files with 121 additions and 18 deletions
+10 -15
View File
@@ -4,13 +4,12 @@
##################################################################################################
#-----------------------------------------------------------------------------------------------
#----------------------------- Host Detection ---------------------------------------------------
#----------------------------- Host and Remote Detection ---------------------------------------
#-----------------------------------------------------------------------------------------------
# Define the hostnames of both servers
HOST1="unRAID-Gmer4Lfe"
HOST2="unRAID-Jayred365"
# Detect local hostname
LOCAL_HOSTNAME="$(hostname)"
if [[ "$LOCAL_HOSTNAME" == "$HOST1" ]]; then
@@ -27,7 +26,7 @@ echo "Local server: $LOCAL_SERVER_NAME"
echo "Remote server: $REMOTE_SERVER_NAME"
#-----------------------------------------------------------------------------------------------
#----------------------------- Remote Server Resolution -----------------------------------------
#--------------------------- Remote Server Ip Resolution ----------------------------------------
#-----------------------------------------------------------------------------------------------
# Resolve Tailscale IP dynamically
REMOTE_SERVER=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null)
@@ -78,19 +77,15 @@ CONTAINER_DELAY=5
#-----------------------------------------------------------------------------------------------
# Profiles are inferred from the directory basename (lowercased)
#-----------------------------------------------------------------------------------------------
#----------------------------- Profile Performance Tuning ---------------------------------------
#-----------------------------------------------------------------------------------------------
# Max rsync processes per profile
declare -A PROFILE_MAX_PROCS
PROFILE_MAX_PROCS["arrs_stack"]=2
PROFILE_MAX_PROCS["movies"]=1
PROFILE_MAX_PROCS["critical-data"]=2
PROFILE_MAX_PROCS["shows"]=1
# Bandwidth limits per profile (KB/s, 0 = unlimited)
declare -A PROFILE_BW_LIMIT
PROFILE_BW_LIMIT["arrs_stack"]=5000
PROFILE_BW_LIMIT["movies"]=0
PROFILE_BW_LIMIT["critical-data"]=9500
PROFILE_BW_LIMIT["shows"]=8000
# Retry logic per profile
declare -A PROFILE_RETRY_COUNT
@@ -100,22 +95,22 @@ PROFILE_RETRY_COUNT["shows"]=3
# Sleep between retries per profile (seconds)
declare -A PROFILE_SLEEP
PROFILE_SLEEP["arrs_stack"]=300
PROFILE_SLEEP["movies"]=300
PROFILE_SLEEP["critical-data"]=300
PROFILE_SLEEP["shows"]=300
# Containers to stop/start per profile (space-separated strings)
declare -A PROFILE_CRITICAL_CONTAINER_NAMES
PROFILE_CRITICAL_CONTAINER_NAMES["arrs_stack"]="Sonarr Lidarr Readarr Radarr Prowlarr Bazarr Pinchflat"
PROFILE_CRITICAL_CONTAINER_NAMES["movies"]=""
PROFILE_CRITICAL_CONTAINER_NAMES["critical-data"]=""
PROFILE_CRITICAL_CONTAINER_NAMES["shows"]=""
# Delayed containers per profile (space-separated strings)
declare -A PROFILE_DELAYED_CONTAINERS
PROFILE_DELAYED_CONTAINERS["arrs_stack"]=""
PROFILE_DELAYED_CONTAINERS["movies"]=""
PROFILE_DELAYED_CONTAINERS["arrs_stack"]="Mariadb-Authelia Redis-Authelia Lldap-Gmer4Lfe NginxProxyManager Authelia"
PROFILE_DELAYED_CONTAINERS["critical-data"]="Authelia"
PROFILE_DELAYED_CONTAINERS["shows"]=""
# Delay in seconds before starting delayed containers per profile
# Delay in seconds before starting delayed containers per profile (seconds)
declare -A PROFILE_CONTAINER_DELAY
PROFILE_CONTAINER_DELAY["arrs_stack"]=5
PROFILE_CONTAINER_DELAY["movies"]=0
PROFILE_CONTAINER_DELAY["critical-data"]=10
PROFILE_CONTAINER_DELAY["shows"]=0
#-----------------------------------------------------------------------------------------------