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
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
11-27-2002 11:09 AM
11-27-2002 11:09 AM
i have a cron script that run all minutes from specifc hour, but sometimes the result is not important for me.
Can I disable cron messagem from specific script or all times it runs cron send me a msg?
Thanx.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:14 AM
11-27-2002 11:14 AM
Re: cron msg
0-59 8-17 * * 1-5 /dir/script_to_run 2>&1 | mailx -s "Output from script" email@somewhere.com
This will re-direct standard error to standard out and then e-mail you the output once the script finishes.
Be aware that any redirection in the script itself will effect what you receive from this e-mail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:19 AM
11-27-2002 11:19 AM
Re: cron msg
* HH1-HH2 * * *
This way, if everything goes well, the standard output will go to /dev/null. If your script failed for any reason, you will get a msg.
Is that what you want?
...Manjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:36 AM
11-27-2002 11:36 AM
Re: cron msg
I want to control what I will receive by script. I don't want cron send msg that my script ran...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:51 AM
11-27-2002 11:51 AM
Re: cron msg
# strings /usr/sbin/cron|more
almost towards the bottom ..
..
/usr/bin/echo 'Subject: %s
' | /usr/bin/cat - "%s" | %s %s
cron
/usr/bin/mail
...
Meaning cron by default will email root of its stdout and stderr. If you do not want this email, you will have to redirect the stdout/stderr in the crontab file like suggested by the rest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:53 AM
11-27-2002 11:53 AM
Re: cron msg
cat myoutput | mailx -s "my subject" myself@mycompany.com
then replace it with something like this:
if [ `date +%M` = 0 ]
then
cat myoutput | mailx -s "my subject" myself@mycompany.com
fi
The mailx command will then be executed at every full hour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:58 AM
11-27-2002 11:58 AM
Re: cron msg
Mladen