- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- MAILTO doesn't work with Crontab
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
тАО07-13-2005 03:32 PM
тАО07-13-2005 03:32 PM
MAILTO doesn't work with Crontab
I am trying to setup the mailto in my cron. I created a txt file cron_job1.job.Inside it are these entries:
MAILTO=xxxx@domain.com
10 * * * * /home/group/do.sh
but when i tried to add it using this command:
crontab cron_job1.job
i am getting this error:
MAILTO=xxxx@domain.com
crontab: error on previous line; unexpected character found in line.
Pls. help me guys.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 03:39 PM
тАО07-13-2005 03:39 PM
Re: MAILTO doesn't work with Crontab
is MAILTO a defined variable to a mailx command ?
if not, this will not work.
Why don't you try using mailx instead in your script do.sh
Add the line mailx -s " subject of the email" xxxx@domain.com < outputfile
and that should work
thanks
DP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 03:45 PM
тАО07-13-2005 03:45 PM
Re: MAILTO doesn't work with Crontab
Are you sayin that i should put MAILTO=xxxx@domain.com inside my script? I thought i just need to put this inside the cron txt i created.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 03:56 PM
тАО07-13-2005 03:56 PM
Re: MAILTO doesn't work with Crontab
MAILTO should be a variable defined within the script. This is how I'd put it in a script:
MAILTO=xxx@domain.com
mailx -s "Test Mail" $MAILTO
Regards,
ira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 04:06 PM
тАО07-13-2005 04:06 PM
Re: MAILTO doesn't work with Crontab
I thought by default cron will send the results to root or anyone running the cron...how can i instead of sending it to /var/mail/xxxx forward the mail to my xxxx@domain.com
thnx...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 05:10 PM
тАО07-13-2005 05:10 PM
Re: MAILTO doesn't work with Crontab
The crontab line must look as follows:
10 * * * * export MAILTO=xxxx@domain.com; /home/group/do.sh
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2005 04:16 AM
тАО08-11-2005 04:16 AM
Re: MAILTO doesn't work with Crontab
For those to know: it sends the output of the crontab entries to the specified mailbox, not to the mailbox of the crontabs user.
On HP-UX you should either do it in your crontab-script (as proposed by the others) or at the receiving end, create an alias for root in /etc/aliases or some forwarding from ~/.forward or using procmail to selectively handle root-s mail.