How to get a notification when my Mac Mini reboots?
August 21, 2017 8:33 PM   Subscribe

I have a headless Mac Mini with OSX El Capitan 10.11.6 with Server installed. It reboots every now and again to perform regular software updates, and then gets stuck at the login screen waiting for me. How can I automatically have a notification (Tweet, iOS notification, IFTTT, etc) be sent to me when I need to login?
posted by photovox to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
I realize this is not directly what you're looking for, but would setting the Mac to auto-login eliminate the need for a notification and manual intervention? Apple: Set your Mac to automatically log in during startup
posted by zachlipton at 8:49 PM on August 21, 2017 [6 favorites]


There may already be a product out there that does this, but you could use launchd to run a script that sends whatever notification you want.
posted by primethyme at 8:52 PM on August 21, 2017


Check out the cron documentation (man 5 cron). If OSX support the @reboot option, you can arrange to run a script whenever the Mac Mini restarts. The rest is left as an exercise.
posted by dws at 9:04 PM on August 21, 2017


Idk what kind of init system OSX uses, but on every other *ix based OS, the easy way to do this is to add a script that runs on system startup that sends an email. Assuming 'mail' is available one line like "mail -s 'Mac Mini started' your@email.here" would send you a blank email with the subject "Mac Mini started"

"echo 'Whatever body text' | mail -s 'subject' your@email.here" lets you specify body text. Or if you have a whole message in a text file that you want to include you can use the redirection operator like "mail -s 'subject' your@email.here < /path/to/email/body"

(In all cases, remove the outer double quotes)

Apparently you can either add a line to /etc/rc.common or create a new file as outlined here.
posted by wierdo at 9:25 AM on August 22, 2017


OS X supports @reboot in crontab, so you could run any script there to mail or run a web request.
https://stackoverflow.com/questions/20710776/how-to-execute-a-crontab-os-x-10-9-when-mac-is-turned-on-again
posted by nickggully at 4:02 PM on August 22, 2017 [1 favorite]


You might want to look for more of a dead-mans's switch sort of solution. Have the Mac do something every X minutes and have a service that sends you a notification if it hasn't seen the Mac do the thing for X+Y minutes. That way you'll be notified when it goes offline for any reason (assuming the watchdog continues to work).
posted by jimw at 1:36 AM on August 23, 2017


« Older Help me access my education at my job.   |   The sub-$500 Folding Electric Bike Newer »
This thread is closed to new comments.