Посмотреть список последних логинов:
last
Если выдается ошибка:
/var/adm/wtmpx: Value too large for defined data type
root@solaris# /usr/lib/acct/fwtmp < /var/adm/wtmpx > /tmp/wtmpx.orig
root@solaris# cat /dev/null > /var/adm/wtmpx.tmp
root@solaris# /usr/lib/acct/fwtmp -ic < /var/adm/wtmpx.tmp > /var/adm/wtmpx
root@solaris# gzip /tmp/wtmpx.orig
root@solaris# cp /tmp/wtmpx.orig.gz /var/adm/
>Can one reduce the size of wtmpx ?
Yes, you can do that in a number of ways. `dd' works, but you have to
know that the record size in that file is 372. You have to copy
multiples of that record size. Something like this will extract the
second record, for example:
$ dd bs=372 count=1 skip=1 if=wtmpx | od -c
Еще вариант:
You can use /usr/lib/acct/fwtmp for this. See fwtmp(1M).
To e.g. create a new wtmpx containing only the last 1000 records of
your old one, do:
# /usr/lib/acct/fwtmp < wtmpx | tail -1000 | /usr/lib/acct/fwtmp -ic > /tmp/wmtpx.new
Using logadm
The same goal may be achieved with logadm utility in Solaris starting with 9 version (or logrotate in GNU platforms).
# logadm -w wtmpx /var/adm/wtmpx -C 2 -c -p 1m
http://www.c0t0d0s0.org/archives/6394-Less-known-Solaris-features-logadm.html
|