Skip to content

TonyWhite/PowerLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Power Log

Records power-on and power-off history, even in the event of a power failure.

This is useful for *NIX machines without an UPS.

You can monitor if your PC is used when you are away.

⭐ Features

⚑️ Record power-on and shutdown

πŸ”Œ Record power failures

πŸ“œ Log in CSV format

⬆️ Easy updates

πŸ€“ Features for nerds

πŸͺΆ Dependencies β‰… 0

The required packages are already installed in most Linux distributions.

πŸ›‘οΈ Protected from process killing!

Simply follow these instructions.

πŸ”₯ Usable everywhere

You can use in proprietary Linux OS, where you can not install custom packages.

πŸ’ͺ Resilient to updates

You can update the program while it is running.

βš™οΈ Installation

Check if you already have the following packages

  • bash
  • coreutils
  • cron (recommended)
  • procps
  • wget OR curl (recommended at least one to download updates)

Download the script

If you have wget:

wget "https://raw.githubusercontent.com/TonyWhite/PowerLog/main/power-log" -O "power-log"

If you have curl:

curl "https://raw.githubusercontent.com/TonyWhite/PowerLog/main/power-log" -o "power-log"

Install the script with root privileges

sudo bash power-log --install

πŸ› οΈ Configure

Open cron

sudo crontab -e

Add the rule

* * * * * bash -c ' for i in {1..60} ; do power-log --single ; sleep 1s ; done '

And this is the better choice with protection from accidentally kill

πŸš€ Usage

Open /usr/share/power-log/power.log with Calc of LibreOffice or OpenOffice. The format is CSV (Comma Separated Values).

Enjoy the logs πŸͺ΅πŸ¦«

About

Records power-on and power-off history

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages