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

Re: Calculating Last Login on Unix

Thread Previous | Thread Next
From:
drieux
Date:
April 29, 2002 11:23
Subject:
Re: Calculating Last Login on Unix
Message ID:
2C852AB4-5B9E-11D6-88C8-0030654D3CAE@wetware.com

On Monday, April 29, 2002, at 10:58 , gkhgkh@attbi.com 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
		.....

	}



ciao
drieux

---


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About