save counter between restarts

1) The proper way to install this system on debian machines (in prefer of make install).
2) save records counter between restarts.