- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron / mail
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
Forums
Discussions
Discussions
Discussions
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
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
04-18-2007 10:32 PM
04-18-2007 10:32 PM
cron / mail
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 10:49 PM
04-18-2007 10:49 PM
Re: cron / mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 10:53 PM
04-18-2007 10:53 PM
Re: cron / mail
if you want the cron entry to disable you can add a commit # in front of the line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 11:11 PM
04-18-2007 11:11 PM
Re: cron / mail
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
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 11:30 PM
04-18-2007 11:30 PM
Re: cron / mail
mail resulting from cron execution indicates that the job has produced output that could not be redirected to e.g. a file.
Therefore, if you take care of redirecting all output to a file (or more files), there will be no reason for sending any mail.
Example without redirection, which may produce mail:
00 9-15 * * 1-5 su sysadm -c /usr/local/bin/mail_top.sh >/tmp/mail_top.sh.yt
Example with redirection:
00 9-15 * * 1-5 su sysadm -c /usr/local/bin/mail_top.sh >/tmp/mail_top.sh.yt 2>&1
In the example with redirection you should pay attention to the fact that the shell evaluates redirection from left to right:
First, std. out is associated with the file /tmp/mail_top.sh.yt
Secondly, std. err ("2") is associated with whatever std. out ("1") is associated with. As std. out was already associated with the file /tmp/mail_top.sh.yt then std. err will go to the same file.
The example only show redirection from the two "normal" output channels, std. out and std. err. Technically, a job could produce output to other data channels, but let us for a start assume that this not the case!
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 11:36 PM
04-18-2007 11:36 PM
Re: cron / mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 09:08 AM
04-19-2007 09:08 AM
Re: cron / mail
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Here is how to reopen a thread:
http://forums1.itrc.hp.com/service/forums/helptips.do?#41
>John: a job could produce output to other data channels,
cron only cares about stdout and stderr.