使用last报Value too large

来源:互联网 发布:阿里云与腾讯云比较 编辑:程序博客网 时间:2024/06/04 21:16

$ last | more
/var/adm/wtmpx: Value too large for defined data type

# cd /var/adm
# /usr/lib/acct/fwtmp < wtmpx > wtmpx.ascii

edit wtmpx.ascii by "vi" or "tail"

# /usr/lib/acct/fwtmp -ic < wtmpx.ascii > wtmpx
# rm wtmpx.ascii

——————————————————————————————————————————

# cp /var/adm/wtmpx /var/adm/wtmpx.old
# > /var/adm/wtmpx


按照这个方法清空了wtmpx文件

ksh下

# logadm -w wtmpx -c -C 3 -p 1m /var/adm/wtmpx
Where :

-w writes an entry in the /etc/logadm.conf file with entry name "wtmpx".
-c is a flag to copy and then truncate the file
-C is the number of copies to keep
-p is the retention period (one month here)

可以限制last保存的时长

 

 

另外,LINUX下的last文件可在/var/log/下的wtmp文件中找到。

原创粉丝点击