Possible Duplicate:
Receiving power notifications (especially shutdown) on Mac OSX
Hi Guys,
I'd like 开发者_Python百科to be able to log the times that my mac is switched on and off during the day (keeping track of my hours jacked-in). Switched on is easy: I just have a tiny script that writes the time to a logfile when the user logs on, but I can't find a way of record the time that the Mac powers down.
Any Ideas? I'm not particularly bother about non-standard shutdowns and the like, just really want to get a small script to run on shutdown...
Thanks,
Joe
If you are just interesting it the dates of the events (not necessarily running a script), try last reboot shutdown
in Terminal.
The “reboot” entries are when the system was started. The “shutdown” entries are when it was shutdown.
精彩评论