Home
Name Modified Size InfoDownloads / Week
scripts 2015-06-06
README 2015-06-08 2.0 kB
install.sh 2015-06-08 964 Bytes
Makefile 2015-06-06 435 Bytes
TODO 2015-06-06 144 Bytes
show_counter.c 2015-06-06 7.4 kB
persistent_counter.c 2015-06-06 9.9 kB
Totals: 7 Items   20.8 kB 0
English is not my first language. You can probably tell.
If something looks or sounds a bit strange - that's my dutch kicking in - sorry. 

I was wondering how many times my raspberry pi's had rebooted since I got them.
As I looked into it I found i could sort of see at what times my pi's booted.
But only over the last three months. Which is not quite the answer.

Okay.

But I kept wondering.
And then I started wondering if anybody else had thougt of this.
I looked for on-line and found no easy way to get an answer.

Then I thought it would be handy to have a sort of general counter that
could keep a persistent count of anything I would care to count.
This became two small tools: one to increment and one to query.

Persistent_counter needs at least one argument.
This can be either a <name> or a <path + filename>.
Each <name> of <path + filename> is a separate counter.
The <name> counters are store in : /var/persistent_counter/<userid>/<name>.dat

show_counter show the current value. It's manipulated as a unsigned long long
so you should be able to without worrying for quite a bit.
 
show_counter can also show the audit trail - if available.
To show the audit-trail specify -a.

If you want to add more info to a counter for yourself or the people using your
system you can add it in a file called <name>.dat.notes
When you call show_counyter -f it should also show these notes.


Persistent_counter works best in scripts. That way it's allways
called the same way. (With or without audit-trail info).

I'm counting system boot and shutdown. I hope to sort of infer from these
how many times the pi's hang up without proper shutdown.
I'm counting some of the system services. (mpd, nqs and mysql)
These are counters owned by root.
And I count some small project-rebuild.

If you found something useful to count - I'd be interested - so if you feel like
it please drop me an email. (rko15@xs4all.nl)

Kind regards
	Rudy Koetsier - still counting


Source: README, updated 2015-06-08