We use Clients & Profits for client billing and it is unable to backup the database if any users have their client app running. I was the bad guy last night that forgot to log out and decided that there has to be some easy way to kill an idle app. I didn’t find any Mac apps that did exactly what I wanted, but I realized that between cron and applescript, I should be able to do what I wanted in a reasonably elegant way.
osascript lets you send Applescript commands to apps from the command line. A little experimentation shows that:
osascript -e ‘quit app “Clients & Profits X 10.2″‘
cleanly exits the app. a quick crontab -e from the terminal allowed me to:
#min hour mday month wday command30 23 * * * osascript -e ‘quit app “Clients & Profits X 10.2″‘
So now at 11:30 pm nightly, if my machine is running, I’ll cleanly shut down C&P.
-
Chris Lawrence
-
Chris Lawrence
-
http://jonathan-peterson.com/ Jonathan Peterson
-
Chris Lawrence