Sending cronjob log to external email


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending cronjob log to external email
# 1  
Old 08-22-2006
Sending cronjob log to external email

Hi All,

I would like to know if there away to send cronjob log to external email (such as nazri76@domain.com) instead of to /var/spool/mail/root .

If so, can we attach a file in the mail (e.g. test.log) ?

Need guidance from you guys!
# 2  
Old 08-22-2006
Assuming you are using a unix account named, coocoo to run your job.

- login as coocoo user
- vi $HOME/.forward
- Add in your email address in the .forward

To verify, send mail to coocoo user like this:

mailx for Solaris, mail for Linux
---------------------------
mailx -s "test mail forwarding to coocoo" coocoo
uuencode test.log test.log | mailx -s "test test.log forwarding to coocoo" coocoo
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cronjob output to file AND to email (as attachment)

I have a shell script that runs on our webserver logs, and grabs various useful data and then outputs this data to a .csv file. What I want to do now is schedule a cronjob to run this script for me each week at a designated time, AND email the .csv file that is created as an attachment to... (1 Reply)
Discussion started by: xdawg
1 Replies

2. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

3. Shell Programming and Scripting

cron not sending external mails

This script is to send a email if the IP adress is active when i run this script it is working and sending emails to external users in different domains, but when this script is scheduled in a cron it is unable to send the emails #/bin/sh ifconfig -a | grep 192.168.0.1 if ; then mail -s... (10 Replies)
Discussion started by: robo
10 Replies

4. Shell Programming and Scripting

php code - Sending mail with external SMTP server

Here is the code: <?php //new function function loadini($path) { $fp = fopen($path, "r"); $fpcontents = fread($fp, filesize($path)); fclose($fp); return $fpcontents; } $to = "test@test.com"; $nameto = "notme"; $from = "test"; $namefrom = "Who From"; ... (0 Replies)
Discussion started by: galford
0 Replies

5. UNIX for Dummies Questions & Answers

Sending through an external e-mail account

Hi guys. After several Google hours, i've failed to find a solution to my problem, maybe my google skills arent that good - but i hope someone could help me figure this out. I'm running a ubuntu server 11.04 with postfix installed. I have installed Request tracker 4 and configured it to read... (2 Replies)
Discussion started by: spirm8
2 Replies

6. OS X (Apple)

mailx to external email address

Hi, How can I use "mailx" command to send message to an email address like this? echo "This email body" | mailx -s "my subject" "email@hostname.com" There may be some setup required in sendmail or postfix?? OS = Snow Leopard 10.6 (4 Replies)
Discussion started by: FlyingSquirrel
4 Replies

7. Shell Programming and Scripting

Running script that sends an html formatted email fails when its run as cronjob

Hi Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem. Im... (15 Replies)
Discussion started by: Nightowl
15 Replies

8. AIX

Problem sending mail to an external domain

On one of our AIX servers, I'm having problems sending email to an external domain. I'm not a SYSADM and not sure how to troubleshoot this issue. Any help will be greatly appreciated. The following mail components are installed on the server $ lslpp -l bos.mh Fileset ... (2 Replies)
Discussion started by: voorkey
2 Replies

9. UNIX for Dummies Questions & Answers

Sending email w/ ftp log as attachment

Can this be done? Code samples welcome and encouraged. (2 Replies)
Discussion started by: idesaj
2 Replies

10. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies
Login or Register to Ask a Question