- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Trim mail.log to a certain size or upto entere...
Operating System - HP-UX
1753454
Members
6095
Online
108794
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
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
тАО05-17-2004 07:55 PM
тАО05-17-2004 07:55 PM
Hi,
Can anyone help me in perl script? I am trying to write perl script which will delete lines above the given date or delete certain lines from above. That means the program will asked the date and will delete lines above that date OR it may asked for no. of lines to be deleted.
Any help will be appreciated. I am using perl 5.8.0 version.
My logfiles look like:
Apr 1 00:00:00 Bombay sendmail[13366]: AAA13366: from=root, size=264, class=0, pri=30264, nrcpts=1, msgid=<200403311830.AAA13366@Bombay.abc.com>, rel
ay=root@localhost
Apr 1 00:00:01 Bombay sendmail[13416]: AAA13366: to=tapas, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:00, mailer=local, stat=Sent
......
.......
May 1 00:00:00 Bombay sendmail[13366]: AAA13366: from=root, size=264, class=0, pri=30264, nrcpts=1, msgid=<200403311830.AAA13366@Bombay.abc.com>, rel
ay=root@localhost
May 2 00:00:01 Bombay sendmail[13416]: AAA13366: to=tapas, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:00, mailer=local, stat=Sent
Rgds
Tapa
Can anyone help me in perl script? I am trying to write perl script which will delete lines above the given date or delete certain lines from above. That means the program will asked the date and will delete lines above that date OR it may asked for no. of lines to be deleted.
Any help will be appreciated. I am using perl 5.8.0 version.
My logfiles look like:
Apr 1 00:00:00 Bombay sendmail[13366]: AAA13366: from=root, size=264, class=0, pri=30264, nrcpts=1, msgid=<200403311830.AAA13366@Bombay.abc.com>, rel
ay=root@localhost
Apr 1 00:00:01 Bombay sendmail[13416]: AAA13366: to=tapas, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:00, mailer=local, stat=Sent
......
.......
May 1 00:00:00 Bombay sendmail[13366]: AAA13366: from=root, size=264, class=0, pri=30264, nrcpts=1, msgid=<200403311830.AAA13366@Bombay.abc.com>, rel
ay=root@localhost
May 2 00:00:01 Bombay sendmail[13416]: AAA13366: to=tapas, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:00, mailer=local, stat=Sent
Rgds
Tapa
Tapas Jha
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 01:12 AM
тАО05-18-2004 01:12 AM
Solution
Why re-invent the wheel?
Look at logrotate:
http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Rgds...Geoff
Look at logrotate:
http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 05:18 PM
тАО05-18-2004 05:18 PM
Re: Trim mail.log to a certain size or upto entered month
Geoff,
logrotate is perfectly fine. I will install the logrotate. Thanx a lot.
But at the same time i just want to learn perl and that is why i am trying for that. :))
Any help will be good for me.
Rgds
Tapas
logrotate is perfectly fine. I will install the logrotate. Thanx a lot.
But at the same time i just want to learn perl and that is why i am trying for that. :))
Any help will be good for me.
Rgds
Tapas
Tapas Jha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2004 05:27 PM
тАО05-18-2004 05:27 PM
Re: Trim mail.log to a certain size or upto entered month
There is a perl solution here. I've tried it and it works great.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=554710
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=554710
Anyone for a Mutiny ?
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP