How to parametrize the sleep/hibernate behavior of a MacBook Pro I try to run some operations in the background (an rsync operation) and the mac goes into background without interactions. The behavior I would to have is:


If the screen is opened then maybe the screen go black, but operations going into the background continue.
If the screen is closed then the mac stops, internet connections are stopped, but the memory remain intact and it can restart afterwards.


How could I change the sleep/hibernate behavior of the macintosh? Right now, I have to stay in in order for background operations to continue and that is not very usable.
You need to open System Prefences > Energy Saver. In the "Battery" tab, you'll find a slider for "Computer sleep".  This determines the amount of the time the computer stays awake when idle (i.e. user not actively at the computer). 

If you set the slider to "Never", it will let operations continue indefinitely (even though the display itself is blanked). Ofcourse operations will stop when the battery runs out.

When you close the lid on the computer, the Mac will go to sleep as usual.