I need help for writing a logon/logoff script for recording user's computer usage time. This is for local login only, not for ssh or something like that.
When a user logon, there should be a temp file (/home/acct/login_temp) generated including the logname and logon time information in the format like "LogName LogonTime".
When a user logoff, combine temp file and logoff time (in the format of "LogName LogonTime LogffTime"), and append the line to the file /home/acct/Log.txt".
The time format should be hh:mm:ss MM/DD/YY. and the logname should take 10 character (add space if needed).
I guess this is quite a simple job to most of your guys. Hope I can get help here.