- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: last login date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 07:57 PM
тАО03-27-2008 07:57 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 11:48 PM
тАО03-27-2008 11:48 PM
Re: last login date
The "last" command usually reads /var/log/wtmp, not /var/log/lastlog.
Many Linux distributions have a "logrotate" tool that is usually configured to archive the system logs, including /var/log/lastlog and /var/log/wtmp, with some cycle. The usual cycle for the lastlog and wtmp files is once a month, and the archiving is set to happen on 1st of each month.
Go to the /var/log directory and look for files named like "wtmp.1" or "wtmp.1.gz": these are the archived versions of the files. If they have a .gz suffix, logrotate has compressed them and you may need to use gunzip to uncompress them before examining them.
You can usually use "last -f /var/log/wtmp.1 userid" to check the information of the previous month. If you want to store the login information for a longer time, modify the logrotate settings in /etc/logrotate.conf and/or in files in the /etc/logrotate.d directory as required.
Please read "man logrotate" for more information.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2008 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2008 03:56 PM
тАО03-28-2008 03:56 PM
Re: last login date
$ vi /etc/logrotate.conf
(find the /var/log/wtmp section)
rotate 12 (was rotate 1)
-Jared
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2008 04:01 PM
тАО03-28-2008 04:01 PM
Re: last login date
last "$@"
for cnt in $(seq 12)
do
[ -a /var/log/wtmp.$cnt ] || break
last -f /var/log/wtmp.$cnt "$@"
done
Jared