# hibernate/suspend history

## cyberjun

Hi,

     Is there a command which can tell me how many cycles of suspend and hibernate the machine has gone through after last reboot?

If not is there an easy way/script to find out. Wouldn't it be fun to find out how many suspend cycles the machine has handled successfully.   :Very Happy: 

--cyberjun

----------

## ultraincognito

If you use pm-utils for suspend for ram then add to /sbin/pm-suspend before "exit $r" next:

```
echo `date` "pm-suspend" >> /home/cyberjun/suspend-log.txt
```

----------

## Hu

If you use /usr/sbin/hibernate from sys-power/hibernate-script, you could probably derive the data by examining /var/log/hibernate.log.

----------

## cwr

Hibernate/suspend logs _something_ to /var/log/messages, but I'm not sure what.

Grep is your friend.

Will

----------

## ultraincognito

I haven't /var/log/messages, but I have pm-powersave.log and pm-suspend in /var/log. It is the best for such task if you use pm-utils because it needn't a filter unlike dmesg.

----------

## cyberjun

Hi,

     Shouldn't pm-utils or hibernate-script et al. log entries in wtmp just like shutdown,halt,poweroff etc. do? This way existing utilities like last can show hibernate/suspend history easily. As hibernate/suspend functionality is becoming more and more important (and stable) for linux laptop users, I feel logging wtmp entries would be a welcome step. What do you all think?   :Smile: 

--cyberjun

----------

