Admin Problems

Christian Marcelo C. Pinheiro (cmcp@caviar.igce.unesp.br)
Tue, 12 Aug 1997 14:43:43 -0300 (ADT)

Hello all,

Its my first time in this mailing list, and I have a problem
to solve:

Im a system administrator and I have to count and show to all of my users
how long they have acessed in the current month. To show, I will send the
file results to an HTML file, using perl. But the problem is to create
the file which sum the number of hours of each username.

SUMDATE do it, if used in pipeline with lineparser (both scripts in
perl), but the problem is sumdate receive two parameters: inicial_date
and final_date; sumdate will sum for each username the number (in hours)
they were acessed between inicial_date and final_date. But SUMDATE dont
consider the case (its hard to explain): imagine a user who have 20 hours
per month to acess my system. He pays $35 for 20 hours. If he uses 10
hours until 05/31 and in the 31/05, at 15:00h he acess again, and stay
for 10 hours, its obvious that he used 19 hours in may and already used 1
hour in jun. But he will be billed for 10 hours in may and for 30 hours
in jun, because he trepass the midnight hours accessed in the last day of
may. On jun, he will have to pay for 10 adicional hours, and its not
justice.

Sorry my english, im from Brazil, but I hope its ok. If
someone have a solucion to my problem, or doubts (maybe its not
understandness), I can explain again. Together I will attach the
lineparser and sumdate script for whose dont know.

Thank's

Christian McPinheiro
cmcp@sagesse.com.br