HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron without email ..
Operating System - HP-UX
1831387
Members
3553
Online
110025
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
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
11-24-2001 09:12 PM
11-24-2001 09:12 PM
Hey everyone
Is there a way to fix a cron job so it does not send an email to root's email? Or is there a way to send it to someone elses email?
Thanks
Richard
Is there a way to fix a cron job so it does not send an email to root's email? Or is there a way to send it to someone elses email?
Thanks
Richard
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2001 11:13 PM
11-24-2001 11:13 PM
Solution
Hi
Cron will always automatically mail output for stdout
and stderr to root unless you specifically state in the
command that stdout and stderr are redirected elsewhere.
To disable cron from mailing output to root add the following to the end of the
cron entry:
> /dev/null (this redirects std. out to the bit bucket)
2> /dev/null (this redirects std. error to the bit bucket)
> /dev/null 2>&1 (this redirects both std. out and std. error)
Here are a couple of examples:
0 1 * * * /path/command [options] > /dev/null
0 1 * * * /path/command [options] > /dev/null 2>&1
Cron will always automatically mail output for stdout
and stderr to root unless you specifically state in the
command that stdout and stderr are redirected elsewhere.
To disable cron from mailing output to root add the following to the end of the
cron entry:
> /dev/null (this redirects std. out to the bit bucket)
2> /dev/null (this redirects std. error to the bit bucket)
> /dev/null 2>&1 (this redirects both std. out and std. error)
Here are a couple of examples:
0 1 * * * /path/command [options] > /dev/null
0 1 * * * /path/command [options] > /dev/null 2>&1
love computers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2001 01:17 AM
11-25-2001 01:17 AM
Re: cron without email ..
Hi Richard,
If you want to forward all the mails sent to root to another user you can specify that in the mail alias. Set another mail id for and alias named root. In some of my systems an alias is set where all mail to root are forwarded to my email address. This way all cron messages will be forwarded to that email address.
Hope this helps.
Regds
If you want to forward all the mails sent to root to another user you can specify that in the mail alias. Set another mail id for and alias named root. In some of my systems an alias is set where all mail to root are forwarded to my email address. This way all cron messages will be forwarded to that email address.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 11:12 AM
11-26-2001 11:12 AM
Re: cron without email ..
Richard,
I've been trying for 2 days to respond but the Forums Gods were apparently against me!
Anyway, here is what I do to redirect cron job output to a different e-mail address:
00 14 * * 5 /dir/to/cron/script 2>&1 | mailx -s "Output from /dir/to/cron/script" youaddress@mail.com
That redirects standard out to standard error and pipes it all to mailx to mail it to you. Works pretty well. The examples Eran gave you work if you don't want any messages.
I've been trying for 2 days to respond but the Forums Gods were apparently against me!
Anyway, here is what I do to redirect cron job output to a different e-mail address:
00 14 * * 5 /dir/to/cron/script 2>&1 | mailx -s "Output from /dir/to/cron/script" youaddress@mail.com
That redirects standard out to standard error and pipes it all to mailx to mail it to you. Works pretty well. The examples Eran gave you work if you don't want any messages.
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP