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.




Webhead
1877 posts

Uber Geek
+1 received by user: 550

Trusted
Subscriber

Topic # 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.





Create new topic
97 posts

Master Geek
+1 received by user: 2


  Reply # 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



Webhead
1877 posts

Uber Geek
+1 received by user: 550

Trusted
Subscriber

  Reply # 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 :)




 
 
 
 


32 posts

Geek
+1 received by user: 3


  Reply # 1416896 30-Oct-2015 11:55
Send private message

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



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Less news in Facebook News Feed revamp
Posted 15-Jan-2018 13:15


Australian Government contract awarded to Datacom Connect
Posted 11-Jan-2018 08:37


Why New Zealand needs a chief technology officer
Posted 6-Jan-2018 13:59


Amazon release Silk Browser and Firefox for Fire TV
Posted 21-Dec-2017 13:42


New Chief Technology Officer role created
Posted 19-Dec-2017 22:18


All I want for Christmas is a new EV
Posted 19-Dec-2017 19:54


How clever is this: AI will create 2.3 million jobs by 2020
Posted 19-Dec-2017 19:52


NOW to deploy SD-WAN to regional councils
Posted 19-Dec-2017 19:46


Mobile market competition issues ComCom should watch
Posted 18-Dec-2017 10:52


New Zealand government to create digital advisory group
Posted 16-Dec-2017 08:47


Australia datum changes means whole country moving 1.8 metres north-east
Posted 16-Dec-2017 08:39


UAV Traffic Management Trial launching today in New Zealand
Posted 12-Dec-2017 16:06


UFB connections pass 460,000
Posted 11-Dec-2017 11:26


The Warehouse Group to adopt IBM Cloud to support digital transformation
Posted 11-Dec-2017 11:22


Dimension Data peeks into digital business 2018
Posted 11-Dec-2017 10:55



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.

Alternatively, you can receive a daily email with Geekzone updates.