- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to trim the logfiles with active process w...
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
тАО11-03-2010 01:37 AM
тАО11-03-2010 01:37 AM
How to trim the logfiles with active process writing to?
Thanks, Aldis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:00 AM
тАО11-03-2010 02:00 AM
Re: How to trim the logfiles with active process writing to?
How about using only the ">" symbol.
Eg.
# > /var/adm/syslog/syslog.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:12 AM
тАО11-03-2010 02:12 AM
Re: How to trim the logfiles with active process writing to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:19 AM
тАО11-03-2010 02:19 AM
Re: How to trim the logfiles with active process writing to?
#!/bin/sh
export today=`date -u +%b%d`
cd /var/adm/syslog
#
cat syslog.log |grep Logging |mailx -s "trim syslog" root
# Copy active file to old directory
cat syslog.log >./old.syslog/$today.syslog
cat mail.log >./old.maillog/$today.maillog
# Initialize active file
>syslog.log
>mail.log
# Delete file(s) older than 120 days from old directory
find /var/adm/syslog/old.syslog/ -mtime +120 -exec rm {} \;
find /var/adm/syslog/old.maillog/ -mtime +120 -exec rm {} \;
Hope this will help you.
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:24 AM
тАО11-03-2010 02:24 AM
Re: How to trim the logfiles with active process writing to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:28 AM
тАО11-03-2010 02:28 AM
Re: How to trim the logfiles with active process writing to?
Try copying /dev/null over the log file. Also see if you can find any option in sam.
Refer:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1033864
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:34 AM
тАО11-03-2010 02:34 AM
Re: How to trim the logfiles with active process writing to?
Can u share the output of below commands
1)pwd ( where '>'not working )
2)echo $SHELL
3)ll /var/adm/syslog/syslog.log
4)id
5)check bdf output, if any filsystem reach 99%
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:45 AM
тАО11-03-2010 02:45 AM
Re: How to trim the logfiles with active process writing to?
the cp /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:46 AM
тАО11-03-2010 02:46 AM
Re: How to trim the logfiles with active process writing to?
Any application or OS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-2010 02:47 AM
тАО11-03-2010 02:47 AM
Re: How to trim the logfiles with active process writing to?
If the writer is tracking where he thinks the file position is and writes to that position, you can't change that.