Avoid automatic shutdown I have a MacBook Pro running Lion. Usually, I need to run tasks that takes hours... so I just leave the laptop working before going to bed.

When I wake up, I notice that it tried to shutdown the system. How do I notice this? Well... all apps are closed except for iTerm (which always stops shutdown process when there is more than one tab open).

I tried to search the energy saving settings but there is nothing related to this... I would like to see how to prevent this behavior.
Make sure your power adapter is connected to the Mac while you are sleeping.
In the Power Adapter section in Energy Saver, make the "computer sleep" -> "never".
You don't want your screen is on when you are in bed right? So make "Display sleep" -> some minutes.
Uncheck "Put the hard disk(s) to sleep when possible" and "Restart automatically if the computer freezes".


That should work!