HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: limiting crons output into e-mail
Operating System - Tru64 Unix
1827474
Members
2370
Online
109965
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
Forums
Discussions
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
08-09-2006 05:07 AM
08-09-2006 05:07 AM
limiting crons output into e-mail
I am running cron in hpux 11.00. I run many jobs out of cron each night. I want to limit the size of the output that reaches my mail system. I would like to just see say the first ten lines of each mail message that is received instead of say 100 lines of a particular process that runs each night. I hope this makes sense.
just when you thought you had the answer
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 07:14 AM
08-09-2006 07:14 AM
Re: limiting crons output into e-mail
I think that you best option is to avoid the output of messages from your cron process to STDOUT and STDERRS. Redirect it to a log file and then mail the contents of the N lines of file, for example:
# cat job1.sh
LOGFILE=/tmp/job1.log
find / -ls > $LOGFILE 2>&1
head -10 $LOGFILE | mailx -s "Job1 Finished" user@domain.com
In this case, if job1.sh is executed by cron, will run and redirecto all output to a log file, then in your mail you will have only 10 lines of the logfile.
# cat job1.sh
LOGFILE=/tmp/job1.log
find / -ls > $LOGFILE 2>&1
head -10 $LOGFILE | mailx -s "Job1 Finished" user@domain.com
In this case, if job1.sh is executed by cron, will run and redirecto all output to a log file, then in your mail you will have only 10 lines of the logfile.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 09:12 PM
08-09-2006 09:12 PM
Re: limiting crons output into e-mail
Hello,
You can also try in your crontab :
x x x x x cmd 2>&1 | head -10
Best regards,
You can also try in your crontab :
x x x x x cmd 2>&1 | head -10
Best regards,
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.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP