I would like to check if my computer with Ubuntu 14.04 was actively shutdown, or whether it crashed. I come into the office in the morning and my computer is off while it should have been on. This has happened a number of consecutive days, and I can check the computer goes off around the same time each night. So I want to know if my computer crashed or whether somebody shut it off. Is there a way to get this information from the logs?
Asked
Active
Viewed 4,035 times
2
2 Answers
2
Find in /var/log
a dmesg
issue, command last
to see the exact reboot time. You will see a line starting with reboot (or may be shutdown) for all reboot/crash.
cat /var/log/messages
from a terminal and check for messages at the time stamp of reboot or just before it. dmesg
can give the last boot time messages.

Jack Fosters
- 145
-
The last command is 'last reboot', which uses a special user 'reboot' for this command. – crafter Jun 16 '17 at 10:20
1
Issue the command
grep rsyslogd /var/log/syslog
or for less noise
grep -E 'rsyslogd.*(exit|start)'
If you see matched pairs of (blah blah)exit(blah blah) followed by (blah blah)start lines the system shutdown (at least somewhat) cleanly. If you have two (blah blah)start lines in a row the system did not shutdown cleanly.

SensorSmith
- 231
/var/log/syslog
,last -x
– heemayl Oct 21 '15 at 07:55last -x
command. It seems my computer is crashing at night. – Niels Janssen Oct 21 '15 at 08:40