develooper Front page | perl.beginners | Postings from April 2002

Re: Calculating Last Login on Unix

Thread Previous | Thread Next
April 29, 2002 11:23
Re: Calculating Last Login on Unix
Message ID:

On Monday, April 29, 2002, at 10:58 , wrote:
> ipl of the server and therefore nulls wtmp

good God Man! no one uses 'ipl' - it will scare the kiddies....

Wags is correct that what you want to do is build a db solution,
most likely something with the tie....

since what you are trying to do is parse out when they were last
observed - hence a decent should would be a cron job that fires
nightly to

	a) update the DB
	b) traverse the DB for

		b1: person not logged in for K days
		b2: accounts no longer in the nis/nisplus/LDAP/userManagementTool

I would of course recommend that you do flat last - and cache when
you saw the data....

	my $lastTag =getLastTag();

	open(FH, "last |")....

	while (<FH>) {
		last if /$lastTag/ ;
		#scarf up data for post processing




Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About