I want to build an odometer to track how long I have been on the server since I last reset the counter.
I recently spent quite a bit of time working on one of my school unix servers, and began to wonder how much time I had in the last couple of days. I started trying to think about how I could write either a Bash script program or C program to run when my .bash_profile was uploaded (i.e. when I ssh to the server), the background itself and save the file time when I closed the session.
I know how to get the program to start at login (via .bash_profile) and how to use the C program (by forking?), But I'm not sure how to determine if the ssh session was completed (maybe by looking at the sshd process?) I hope this is the correct stack exchange to ask how you are going for something like this and appreciate any input.
source share