- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- at job and e-mail notification
Operating System - HP-UX
1820565
Members
2099
Online
109626
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
Discussions
Discussions
Discussions
Forums
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
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
тАО06-24-2008 08:27 AM
тАО06-24-2008 08:27 AM
Every time when the at job runs ..it send an e-mail or saves message in /var/mail/useraccount - i want to disable this - is it possible
thanks much
thanks much
Learning ...
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 08:41 AM
тАО06-24-2008 08:41 AM
Solution
Hi:
Like any 'crontask' running 'at' by default redirects STDOUT and STDERR as mail to the user who initiated the job.
To eliminate this, you need to redirect STDERR (fd #2) and/or STDOUT (fd #1) to a file or to '/dev/null'.
You could add something like this to your script:
[ -t 0 ] || exec 1> /dev/null 2>&1
This says if the process isn't associated with a terminal then redirect both STDOUT and STDERR to /dev/null. This eliminates your mail when your script is run via 'at' or 'cron' but not when run interactively from the command line.
Regards!
...JRF...
Like any 'crontask' running 'at' by default redirects STDOUT and STDERR as mail to the user who initiated the job.
To eliminate this, you need to redirect STDERR (fd #2) and/or STDOUT (fd #1) to a file or to '/dev/null'.
You could add something like this to your script:
[ -t 0 ] || exec 1> /dev/null 2>&1
This says if the process isn't associated with a terminal then redirect both STDOUT and STDERR to /dev/null. This eliminates your mail when your script is run via 'at' or 'cron' but not when run interactively from the command line.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 08:51 AM
тАО06-24-2008 08:51 AM
Re: at job and e-mail notification
Thanks
Learning ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 06:09 PM
тАО06-24-2008 06:09 PM
Re: at job and e-mail notification
One caution with JRF's redirection to /dev/null, is that you better not be having any unexpected errors.
You may want to look at your script and only redirect the output on commands you absolutely don't care about.
Or take JRF's idea and redirect to the same file. That way you at least have one run's worth. Or append to the same file and clean out weekly or monthly.
You may want to look at your script and only redirect the output on commands you absolutely don't care about.
Or take JRF's idea and redirect to the same file. That way you at least have one run's worth. Or append to the same file and clean out weekly or monthly.
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
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP