- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to rotate package log file
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
11-06-2007 08:24 AM
11-06-2007 08:24 AM
how to rotate package log file
I'd like to rotate package log files using logrotate but I don't know how to "reset" the file handler that serviceguard uses. In fact, although logrotate creates new log file and renames old one, serviceguard continues to log into old log file.
Is there any way to do this?
Thank You
Best Regards
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2007 08:38 AM
11-06-2007 08:38 AM
Re: how to rotate package log file
Maybe following script may help you. It's not related with logrotate tool but useful
Best Regards
Murat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2007 08:40 AM
11-06-2007 08:40 AM
Re: how to rotate package log file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2007 02:41 AM
11-07-2007 02:41 AM
Re: how to rotate package log file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2007 07:05 PM
11-07-2007 07:05 PM
Re: how to rotate package log file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2007 09:24 PM
11-07-2007 09:24 PM
Re: how to rotate package log file
cd /etc/cmcluster
gzip < somepackage.cntl.log >somepackage.cntl.log.old && > somepackage.cntl.log
This will gzip the old contents of the active log file into a different file, then immediately truncate the active log file without changing the inode number. The truncation must happen ONLY if the gzipping was completed without errors.
This approach is not perfect: there is a "window of vulnerability" if a message comes in exactly in between the gzip completion and file truncation. In that case, that message might be lost.
MK