These are some tools etc ... That I use to automate and keep Channels DVR running smoothly in Windows ..
I have my Windows servers to autologin and set the group policy to never restart to install updates when user is logged on. I check once in a while when Idle and will reboot to update. I also run a program called insomnia at startup that prevents windows from sleeping. These are headless servers with remote desktop enabled. I am running Docker Desktop that does not run as a service and requires Autologin.
I have USB drives and do not want them to sleep so I use KEEPALIVEHD.
Symlinks made easy ... must have.
Reboot when Idle ....
:loop
title "Reboot Channels Server"
CD /d "%~dp0"
curl.exe "http://127.0.0.1:8089/dvr" | findstr /I /C:"busy\":false"
set notbusy=%ERRORLEVEL%
if %notbusy% EQU 0 shutdown /r /f /t 2
if %notbusy% NEQ 0 timeout /T 300
CLS
goto loop
Move recordings when Idle ...
goto start
:loop
timeout 300
:start
CD /d "%~dp0"
curl http://127.0.0.1:8089/dvr | findstr /I /C:"busy\":false"
set notbusy=%ERRORLEVEL%
if %notbusy% NEQ 0 goto loop
ROBOCOPY "W:\DVR\TV\Walker, Texas Ranger" "S:\ChannelsDVR2\TV\Walker, Texas Ranger" /move /COPY:DT /minage:1 /e /R:2 /W:2
ROBOCOPY "W:\DVR\Movies" "\\MYCLOUDPR4100\MyShares\Imports\ChannelsDVR\Movies" /move /COPY:DT /minage:0 /e /R:2 /W:2
MD "W:\DVR\Movies"
goto loop
exit
Auto Check for Prerelease ...
:loop
title "Update Channels DVR"
CD /d "%~dp0"
curl.exe "http://127.0.0.1:8089/dvr" | findstr /I /C:"busy\":false"
set notbusy=%ERRORLEVEL%
if %notbusy% EQU 0 curl -XPUT http://127.0.0.1:8089/updater/check/prerelease
if %notbusy% NEQ 0 timeout /T 300
if %notbusy% EQU 0 timeout /T 1500
rem if %notbusy% NEQ 0 timeout /T 300
CLS
goto loop