![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with Cron Email Notification | sasaliasim | AIX | 1 | 04-29-2008 01:02 PM |
| Crontab change and email notification | coolkid | Shell Programming and Scripting | 3 | 01-02-2008 03:56 PM |
| How to add email notification in scripts? | redlotus72 | UNIX for Dummies Questions & Answers | 2 | 03-14-2005 08:19 AM |
| Why am I not recieving email notification? | Kelam_Magnus | Post Here to Contact Site Administrators and Moderators | 6 | 09-03-2002 11:01 PM |
| email notification if job is killed/dies | jacob_gs | Shell Programming and Scripting | 2 | 05-15-2002 03:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Cron Job notification email
Hi,
I'm fairly new to Aix and am looking for some help on the following. I have setup a cron job under root and want it to send the email once it's run to an external email address. I can get it to send the output in an email to me by using mail on the end of the crontab entry. But I would like to get the email thats sent to root once the cronjob has run as displayed below sent to my external address. /var/spool/mail/root From daemon Mon Jan 12 15:59:01 2009 Received: (from daemon@localhost) by (AIX5.3/8.13.4/8.11.0) id n0CFx1eq1044526 for root; Mon, 12 Jan 2009 15:59:01 GMT Date: Mon, 12 Jan 2009 15:59:01 GMT From: daemon Message-Id: <200901121559.n0CFx1eq1044526@ To: root Subject: Output from cron job su - db2inst1 -c /database/db2inst/sqllib/db2dump/scripts/matt , root@, exit statu s 0 Cron Environment: SHELL = PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin CRONDIR=/var/spool/cron/crontabs ATDIR=/var/spool/cron/atjobs LOGNAME=root HOME=/ Your "cron" job executed on Mon Jan 12 15:59:00 GMT 2009 su - db2inst -c /database/db2inst/sqllib/db2dump/scripts/matt produced the following output: Thanks in advance. Matt. Last edited by elmesy; 01-13-2009 at 06:31 AM.. |
|
||||
|
cronjobs should be designed to create no output, an if they create no output no mail is created
your way with sending the output with a mail command in the job is the preferred way other way: generate a user cron install sudo if not already installed all cron jobs which should send to your email-address must be run from the new users crontab, running commands with sudo/sticky bit specify a mail alias in /etc/sendmail/aliases for the new user newuser:youremail@domain #sendmail -bi sendmail must run #startsrc -s sendmail perhaps there is an easier way ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|