Clicky

20150829

'Syncthing' Windows install script

Pulse was a (not continued) fork of Syncthing (https://syncthing.net/) I spend a couple of posts about installing and configuring Pulse which are more less covering Syncthing too.

One thing has not been fixed for the Windows version of Syncthing: computer resources when Syncthing is active. I have described how to mitigate this but the next script does it all for you. It will (re-)install the Syncthing Windows service with an affinity for a single CPU and at a low priority.

The script requires that NSSM (http://www.nssm.cc/download) x86 or x64 executable is installed in the same folder as the script.


cls

net sessions >nul 2>nul
if %errorlevel% NEQ 0 (
    echo *** This script requires Admin privs. Exiting...
    pause
    goto :EOF
)


net stop syncthing
sc delete syncthing
taskkill /f /im syncthing.exe

md "%ProgramData%\syncthing" >nul 2>nul

nssm install syncthing "%ProgramFiles%\syncthing\syncthing.exe"
nssm set syncthing Application     "%ProgramFiles%\syncthing\syncthing.exe"
nssm set syncthing AppDirectory    "%ProgramFiles%\syncthing"
nssm set syncthing AppParameters "-home=%ProgramData%\syncthing -logfile=%ProgramData%\syncthing\syncthing.log -no-console -no-browser"
nssm set syncthing AppPriority IDLE_PRIORITY_CLASS

::--- Assign one of the %NUMBER_OF_PROCESSORS% cores to Syncthing service (but exclude core #0)...
set /A a="%RANDOM% %% (%NUMBER_OF_PROCESSORS%-1)" + 1
nssm set syncthing AppAffinity %a%


net start syncthing
ping -n 11 127.0.0.1 >nul
start https://127.0.0.1:8384/


Once the service is (re-installed) you can check the Windows task manager what Syncthing is consuming on CPU resources:


No comments :

Post a Comment

Real Time Web Analytics