0

There are commands to check uptime, history of reboots, but how to check time(s) when system was suspended?
Kubuntu 18.04.4 Desktop.

R S
  • 2,419
  • https://askubuntu.com/a/1186845/925971 does this answer your question? – Gryu Apr 20 '20 at 21:35
  • 1
    To start with, which version of Linux have you installed  (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, et al.) , and which release number? Different releases have different tools for us to recommend. Please click [edit] and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with [edit] – K7AAY Apr 20 '20 at 21:35
  • @Gryu no, there are errors in the script. – R S Apr 20 '20 at 21:41
  • I've tried it and it displayed: 1 Suspends 65 seconds ( 1 minute, 5 seconds)\n Real uptime 25655 seconds ( 7 hours, 7 minutes, 35 seconds). It counts suspends starting from the last boot time. It does not count suspends before previous reboots. Just suspended and tried the command again: 2 Suspends 74 seconds ( 1 minute, 14 seconds) – Gryu Apr 20 '20 at 21:43
  • @Gryu I'm getting invalid date and serveral syntax errors, running with bash <script>. – R S Apr 20 '20 at 21:49
  • copy/paste it into some susptime.sh file, chmod +x ./susptime.sh and execute it by ./susptime.sh – Gryu Apr 20 '20 at 21:50
  • 3
    What's wrong with plain journalctl -u systemd-suspend? – steeldriver Apr 20 '20 at 22:33
  • @steeldriver simple and elegant, it does it, thank you. – R S Apr 20 '20 at 22:53
  • @steeldriver: this should be put as an answer – Maciek D. Sep 27 '21 at 06:42

0 Answers0