This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

flix: make sabnzbd auto-resume after disk-full pause

+12 -7
+12 -7
2configs/services/flix/default.nix
··· 158 158 # pause downloads when /var/download runs low, so a full disk can no longer 159 159 # hard-wedge sabnzbd with an unrecoverable "Disk full! Forcing Pause". 160 160 # sabnzbd pauses itself once free disk drops below download_free/complete_free 161 - # (auto-resuming above); this guard keeps those set to THRESH GiB. Transmission 162 - # has no equivalent, so below the threshold the guard stops all its torrents 163 - # (restarting them on recovery) and posts a Matrix alert on each transition. 161 + # and only auto-resumes above if fulldisk_autoresume is set (default off); 162 + # this guard keeps those at THRESH GiB / on, and additionally sends a resume 163 + # on recovery. Transmission has no equivalent, so below the threshold the 164 + # guard stops all its torrents (restarting them on recovery) and posts a 165 + # Matrix alert on each transition. 164 166 systemd.services.download-space-guard = { 165 167 wantedBy = [ "multi-user.target" ]; 166 168 after = [ "sabnzbd.service" ]; ··· 200 202 --data "$body" >/dev/null || : 201 203 } 202 204 203 - # sabnzbd pauses continuously once free disk drops below these (and 204 - # auto-resumes above). Keep them at THRESH GiB; re-assert only if changed. 205 + # sabnzbd pauses continuously once free disk drops below these; keep 206 + # them at THRESH GiB and auto-resume on; re-assert only if changed. 205 207 for k in download_free complete_free; do 206 208 grep -qxF "$k = ''${THRESH}G" "$INI" \ 207 209 || sab "mode=set_config&section=misc&keyword=$k&value=''${THRESH}G" 208 210 done 211 + grep -qxF "fulldisk_autoresume = 1" "$INI" \ 212 + || sab "mode=set_config&section=misc&keyword=fulldisk_autoresume&value=1" 209 213 210 214 prev=ok 211 215 if [ -f "$STATE" ]; then prev=$(cat "$STATE"); fi ··· 219 223 notify "⚠️ yellow: /var/download down to ''${avail} GiB free (< ''${THRESH} GiB). Stopped all transmission torrents; sabnzbd auto-paused via download_free." 220 224 fi 221 225 elif [ "$prev" = low ]; then 222 - echo "free ''${avail}G >= ''${THRESH}G: resumed transmission, alerting" 226 + echo "free ''${avail}G >= ''${THRESH}G: resumed transmission and sabnzbd, alerting" 223 227 tr_remote -t all --start 224 - notify "✅ yellow: /var/download recovered to ''${avail} GiB free. Restarted transmission torrents." 228 + sab "mode=resume" 229 + notify "✅ yellow: /var/download recovered to ''${avail} GiB free. Resumed sabnzbd and transmission torrents." 225 230 fi 226 231 echo "$cur" > "$STATE" 227 232 '';