Looking for a script to stop and start Roon Core on MacOS

Hi there,
as I am running my core on a Mac Mini M1 I have the memory leaking issue and need to restart the Roon core regularly.
I have read that some are doing this by using an autometed script which is doing this once a week.
Does anybody have such a script and would be willing to share it?
As I have no clue about scripts on MacOs. :slight_smile:
Thanks!

You could mess with cron and/or launchd, but the easiest would be to make a little flow in the Shortcuts app like this:

and use a tool like Shortery (paid app, €2,99) for automating things:

That – or you could just have the machine reboot itself once a week:

2 Likes

I’ve set my MacMini Core to restart at 3 a.m. daily after running scheduled database backups and a Carbon Copy Clone backup of the boot drive.

Login is set to automatic and Roon is set as a Login Item so it launched automatically on reboot.

2 Likes

Thanks, will look into your suggested options.
I am a total stranger to MacOS. :wink:

yep, i also do the daily reboot of the core machine (mac mini), and then roonserver relaunches automatically… since doing that it’s resolved many little oddities and nuisances!

2 Likes

You could also do this using an AppleScript. Open AppleScript, paste in the following, then save it as an application (rather than a script - see below). Once you’ve done that add the application to your Login Items (System Preferences → Users and Groups → Login Items).

on run
end run

on idle
   my restartRoonServerWeekly() --- restarts at 05:45:10 on Friday
   return 30
end idle

on quit
continue quit
end quit

on restartRoonServerWeekly()
   set currentDay to weekday of (get current date)
   set myTime to time string of (current date)
   if currentDay = Friday then
      if myTime > "05:45:10" and myTime < "05:46:00" then
         try
            tell application "RoonServer" to quit
         end try
      delay 30
      tell application "RoonServer" to activate 
   end if
end if
end restartRoonServerWeekly

To save a script as an app choose “Application” when you save the file.

Screenshot 2022-02-16 at 21.08.51

1 Like

Thanks! Will try that. :slight_smile:

1 Like