I’ve got RoonServer running on a small, Windows 10 PC that is dedicated to running Roon. Nothing else. So I’m not really inclined to do full backups of the PC. If anything goes wrong, I’ll just reinstall the OS, and reinstall RoonServer. But I’ll be sorry if I don’t have a recent backup of the RoonServer directory. So I created a little batch file that takes care of that, by backing up that directory weekly to a USB thumb drive.
It’s a pretty simple little process. But I figured I’d post it here, should anyone else with a similar need benefit from a brief “how to”.
The batch file consists of the text posted below. You’ll note that I’m copying the RoonServer directory to a pre-existing directory on the D: drive, which is my USB thumb drive. And I’m backing up the RoonServer directory. Anyone trying this will need to make sure you modify those directories and/or drives to where you are backing up to, and from.
TASKKILL /F /IM “RoonServer.exe”
XCOPY C:\Users\steph\AppData\Local\RoonServer D:\RoonServer /C /E /R /y
START C:\Users\steph\AppData\Local\RoonServer\Application\RoonServer.exe
Copying this text into Notepad, and selecting the “all files” option in the “save as type” drop down box when you save the file, will allow you to save it as a *.bat file, vs. the default behaviour of saving it as *.txt. So make sure you save it as something.bat, not something.txt, or something.bat.txt. Save it where ever you want. Since this is a dedicate PC for me, I put it right on the desktop. Oh… and if your Windows 10 setup is like mine, Notepad is hard to find. I had to search for “Notepad.exe”.
If you want to test the batch file, just navigate to where ever you put the file in File Explorer, right click on the file, and select “Run as Administrator”.
To get the the batch file to execute on a regular basis, you’ve got to schedule it with the Task Scheduler. That program can be found by starting the Windows 10 Settings application, and in the apps search bar, search for Schedule Tasks. That will bring up a “Schedule Tasks” option, that upon being clicked, will open the Task Scheduler. That’s one of many ways to find it.
In the Task Scheduler menu bar, click Action/Create task. That will pull up a wizard that will step you through scheduling your batch file to execute whenever, and how ever (priority, etc.) you wish. It’s pretty self explanatory.
After you’ve scheduled the batch file to execute on a regular basis, when it runs, it’ll stop RoonServer, copy the files, and restart RoonServer. And RoonServer seems to weather this fine, except if anything was playing, when RoonServer restarts, whatever was playing will be queued up, but not playing. Though if someone hits the the play button on a Roon remote, it’ll start right up.
Also, I’m NOT a DOS command line guy, so if anyone has any suggestions on useful changes for those command options in the batch file, by all means, please to post comments for improvement.