- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /var/adm/cron/log file size reduction
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
Forums
Discussions
Discussions
Discussions
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
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
09-08-2005 09:41 AM
09-08-2005 09:41 AM
Years ago there were shell programs like logchecker that we could run in cron to check and reduce the size of files like /var/adm/cron/log. Does HP-UX still have anything like that or do we need to write our own? I'm running 10.20
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2005 09:48 AM
09-08-2005 09:48 AM
Solutionhttp://hpux.cs.utah.edu/hppd/hpux/Sysadmin/logrotate-2.5/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2005 09:53 AM
09-08-2005 09:53 AM
Re: /var/adm/cron/log file size reduction
FILELENGTH=`cat /var/adm/cron/log|wc -l`
LINES2TRIM=`echo ${TRIMpct}*(${FILELENGTH}/100)`
sed -e "1,${LINES2TRIM}d" /var/adm/cron/log >/tmp/tmplog.file
cat /tmp/tmplog.file > /var/adm/cron/log
this should reduce the size of a 10,000 line log file to 3,000 lines. Change the value of TRIMpct variable to adjust how much you want to trim from the top.
hope this helps
PS. Don't use head or tail commands as they do not work well on files of large sizes.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2005 09:56 AM
09-08-2005 09:56 AM
Re: /var/adm/cron/log file size reduction
Where I was not permitted to install this, I had a program cron ran that looked like this:
cp $logfile $archive_location
rc=$?
if [ $rc = 0 ]
then
> $logfile
fi
That keeps the filesize under control assuming your archive location is good. If course you need to allocate space to store the copies.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2005 05:03 AM
09-09-2005 05:03 AM
Re: /var/adm/cron/log file size reduction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2005 05:04 AM
09-09-2005 05:04 AM