- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Housekeeping of /var/log/lastlog on Linux
Operating System - Linux
1819804
Members
3093
Online
109607
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО10-17-2005 01:40 PM
тАО10-17-2005 01:40 PM
Hi,
The /var/log/lastlog is really big. I think proper housekeeping is required but any guru can advise the proper way to do so. Can I use logrotate?
Thanks
The /var/log/lastlog is really big. I think proper housekeeping is required but any guru can advise the proper way to do so. Can I use logrotate?
Thanks
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2005 06:23 PM
тАО10-17-2005 06:23 PM
Solution
You can use logrotate with specialised script to archive + zipping files.
# tar -cvzf lastlog.$(date "%d_%m).tar /var/log/lastlog
If you have gunzip support then,
# tar -cvjf lastlog.$(date "%d_%m).tar /var/log/lastlog
# After the above step
> /var/log/lastlog
hth.
# tar -cvzf lastlog.$(date "%d_%m).tar /var/log/lastlog
If you have gunzip support then,
# tar -cvjf lastlog.$(date "%d_%m).tar /var/log/lastlog
# After the above step
> /var/log/lastlog
hth.
Easy to suggest when don't know about the problem!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:23 PM
тАО10-18-2005 05:23 PM
Re: Housekeeping of /var/log/lastlog on Linux
lastlog is a sparse file, so it's not that big (you can check its real size with du).
The following note comes from lastlog(8).
The lastlog file is a database which contains info on the last login of
each user. You should not rotate it. It is a sparse file, so its size
on the disk is much smaller than the one shown by ls -l (which can
indicate a really big file if you have a high UID). You can display its
real size with ls -s.
The following note comes from lastlog(8).
The lastlog file is a database which contains info on the last login of
each user. You should not rotate it. It is a sparse file, so its size
on the disk is much smaller than the one shown by ls -l (which can
indicate a really big file if you have a high UID). You can display its
real size with ls -s.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP