Simple command line:
An interesting alternative would be:
From the man page:
Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can
wake up quicker than for normal hibernation if you do not run out of power, and you can resume even if you run out of power. s2both(8) is an hybrid-suspend
Background story: Electricity problems in Lebanon, and old UPS, causing me plenty of headaches. So I needed a quick way to suspend/hibernate the desktop without loosing all my volatile settings and open files. I added a shortcut for a ConnectBot host configuration on my android phone that runs this command on the desktop (remotely):
This way if the backup generator starts in time or not, everything is back up and running in under
45s12s (just clocked it!).