- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron Email Messages
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
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
тАО03-13-2001 04:34 AM
тАО03-13-2001 04:34 AM
Cron Email Messages
I would like to thank everyone who has helped me in the past. This site is a valuable tool and has saved me many times.
I have anoying and perhaps stupid problem. We have about 20 or 30 crons that run each day on several machines and I get emailed (root gets emailed) after each cron completes. I still want to get these emails, however, it would be helpful if I could stop cron from sending them right away and having it send them to a file and then at the end of the night send just one email with all the results. Is this doable? What do other people do to cut down on message traffic? it sends output from the cron and adds this to the bottom:
***********************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
I am running hp 10.20.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 04:42 AM
тАО03-13-2001 04:42 AM
Re: Cron Email Messages
cron mails you all stdout and stderr output generated by the cronjob.
You could edit each script and redirect all output to one or more files. An other option is to edit the crontab and redirect output of each script there.
e.g.: 0 8 * * * script > /tmp/log1 2> /tmp/log2
regards,
Thierry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 04:50 AM
тАО03-13-2001 04:50 AM
Re: Cron Email Messages
Thierry has a good idea, here some more idieas.
schedule a cron job before all other that clears the summary log file ie:
0 18 * * * rm -f /tmp/cron.log
Now redirect the output of all your cron jobs as Thierry said.
schedule a cron job after all other that mails the summary log file ie:
0 8 * * * cat /tmp/cron.log | mailx -s 'cron summary'
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 05:20 AM
тАО03-13-2001 05:20 AM
Re: Cron Email Messages
One more idea,
You can send the output of each cronjob to a temporary log file and then u put an entry after last cron job to mail that file. for example,
Assuming that u have scheduled last job at 23hrs:
00 00 * * * job1 > /tmp/maillog1 2> /tmp/maillog2
00 01 * * * job2 >> /tmp/maillog1 2>> /tmp/maillog2
..............
..............
00 23 * * * (job24 >> /tmp/maillog1 2>> /tmp/maillog2; cat /tmp/mailog1 /tmp/maillog2 | mailx -s "subject"
Cheers...
Satish.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 05:26 AM
тАО03-13-2001 05:26 AM
Re: Cron Email Messages
Good site!