- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trimming log files
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
05-12-2003 12:16 AM
05-12-2003 12:16 AM
What is the best method of monitoring the log files in the HP-UX System and trimming them?
Do you have any script which trimmes all the log files when the /var fs is 90% full?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 12:49 AM
05-12-2003 12:49 AM
SolutionSAM has a good facility for trimming logfiles:
SAM -> Routine tasks -> System Log Files
where you can manually select files for trimming.
There is at least one script for trimming a logfile in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html
But I would not recommend just to trim the log files if they are filling up; read them and find out why.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 12:54 AM
05-12-2003 12:54 AM
Re: Trimming log files
Trim files is one thing you have to do when /var is nn% full, but also consider to check other things like adm/crash, tmp or adm/sw/save directories.
HTH, Vicente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 12:55 AM
05-12-2003 12:55 AM
Re: Trimming log files
We uses the tool "prune", you can easily configure files to prune. Limits can be given in lines, or bytes.
Source code at
http://wuarchive.wustl.edu/languages/c/unix-c/sysadmin/
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 01:16 AM
05-12-2003 01:16 AM
Re: Trimming log files
see if this helps.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 02:37 AM
05-12-2003 02:37 AM
Re: Trimming log files
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 03:34 AM
05-12-2003 03:34 AM
Re: Trimming log files
Very quick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 04:32 AM
05-12-2003 04:32 AM
Re: Trimming log files
tail -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 06:49 AM
05-12-2003 06:49 AM
Re: Trimming log files
What you suggest to do will not work! The system log is not opened by a filehandle. Your idea would work in a different approach.
tail -1000 /var/adm/syslog/syslog.log >/tmp/tmpsyslog.log
cat /tmp/tmpsyslog.log > /var/adm/syslog/syslog.log
Please try what you suggested and see what happens. Dont worry, unless your /var is full it will not crash the system.
It's a good idea to test suggestions before posting them unless your sure they work ;)
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 03:20 PM
05-12-2003 03:20 PM
Re: Trimming log files
We daily run this rather simple posix shell script to archive our syslogs (not rotate) for up to three months. It assumes that the syslogd configuration is in /etc/syslog.conf and that all active logs are in /var/adm/syslog. A similar procedure can be used to archive Apache logs.
The basic method is to move aside all the current, open logs, create new empty files, and send SIGHUP to syslogd to close the current files and open the new ones.