From: Green, Simon (Simon.Green@EU.ALTRIA.COM)
Date: Thu Mar 25 2004 - 09:22:12 EST
The "time_last_login" field from lsuser has the information you require.
Unfortunately, it's not in an easily intelligible format, being seconds
since the UNIX epoch.
However, you don't really care what the value is: just whether it's greater
or less than an arbitrary date. Therefore, all you need to do is work out
what the time was six months ago and compare the time_last_login value with
that.
A quick estimate makes it something like 1065182400.
((2004-1970)*365.25-90)*24*3600.
So...
lsuser -a time_last_login ALL | while read User Time
do
Time2=`echo $Time|cut -f2 -d'='`
if [[ $Time2 -lt 1065182400 ]]
then
Do whatever.
fi
done
-- Simon Green Altria ITSC Europe Ltd AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html <https://new-lists.princeton.edu/listserv/aix-l.html> New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX <http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX> N.B. Unsolicited email from vendors will not be appreciated. Please post all follow-ups to the list. -----Original Message----- From: terry.german@PHONES4U.CO.UK [mailto:terry.german@PHONES4U.CO.UK] Sent: 25 March 2004 12:37 To: aix-l@Princeton.EDU Subject: Scripting/Information Help Guru's, As I am not a wizz on scripting I was just wondering if anyone out there can help me. I want to find out which users on our M80 running AIX 4.3.3 have not accessed there id for the last 6 months? If anyone could help it would be great...
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:45 EDT