Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


jarledb

Webhead
3319 posts

Uber Geek
+1 received by user: 1983

Moderator
ID Verified
Trusted
Lifetime subscriber

#183682 26-Oct-2015 16:07
Send private message

Been trying to find out if there is any way to restart an application every x hour. Wondering if I should just look into doing it with crontab.

The problem is that this application is running on a headless Mac Mini, and it seems to consume increasing amounts of memory and CPU the longer it runs. Quitting it and then starting it again seems to fix the problem, so being able to schedule it would be nice.





Jarle Dahl Bergersen | Referral Links: Want $50 off when you join Octopus Energy? Use this referral code
Are you happy with what you get from Geekzone? Please consider supporting us by making a donation or subscribing.


Create new topic
Shagy
97 posts

Master Geek
+1 received by user: 2


  #1416249 29-Oct-2015 17:21
Send private message

You could try cronniX and or launchD
And write a bash script to stop/start the application



jarledb

Webhead
3319 posts

Uber Geek
+1 received by user: 1983

Moderator
ID Verified
Trusted
Lifetime subscriber

  #1416398 29-Oct-2015 20:00
Send private message

Good suggestion. Creating a shell script with /usr/bin/killall and /usr/bin/open and then using crontab works a treat :)




Jarle Dahl Bergersen | Referral Links: Want $50 off when you join Octopus Energy? Use this referral code
Are you happy with what you get from Geekzone? Please consider supporting us by making a donation or subscribing.


scetoaux
56 posts

Master Geek
+1 received by user: 15


  #1416896 30-Oct-2015 11:55

Rather than use killall, I'd go with osascript to cleanly quit the application rather than just kill the process.  Something like:

osascript -e 'tell application "Appname" to quit'

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.