0

We have a server running RHEL 5.

Sometimes the power cuts and the server is down (the UPS handles only 30 min).

I want to be able to to identify the time of the shutdown, in an other term the last minute where the server was up.

I tried last command but it only logs shutdown started by a command.

I also checked the /var/log/messages but I don't see anything useful for my question.

1 Answer 1

1

you can try the following command

last -1x shutdown

or the reboot could be helpful in this situation

last reboot | less
1
  • last -1x shutdown is exactly what I need. Thanks! For anyone interested in the output: ``` ❯ last -1x shutdown shutdown system down 5.15.38-1-MANJAR Mon May 23 22:21 - 06:50 (08:29) ``` Here's the flag meaning: ``` -x, --system Display the system shutdown entries and run level changes. ```
    – kohane15
    May 24, 2022 at 1:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .