The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
run a script from incoming email jojo77 UNIX for Dummies Questions & Answers 7 02-22-2008 10:48 AM
Email from script conditionally dfb500 Shell Programming and Scripting 2 05-01-2007 10:01 AM
Email through Script rkumar28 Shell Programming and Scripting 2 03-21-2005 06:55 PM
email extract script gxiong High Level Programming 1 03-21-2005 04:49 PM
Email alert script moon Shell Programming and Scripting 1 04-26-2002 01:55 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-06-2008
Registered User
 

Join Date: Apr 2008
Posts: 39
running sql script and email it

Hi All
I have this sql script lets say abc.sql
How to run this script with this following conditions :
1 - The script will run everyday and mailx to me by using crontab
2 - The output of this script will be saved to someplace and attach with mailx OR can be display as email text and then send to me
Reply With Quote
Forum Sponsor
  #2  
Old 07-06-2008
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 439
Point 1:
You have to edit the crotab using crontab -e to add the entry like:
00 02 * * * sh /tmp/your_script.sh | /usr/bin/mailx "user@domain.com" -s "Subject here"
Point 2:
You can do like:
00 02 * * * sh /tmp/your_script.sh >out_log && uuencode out_log | /usr/bin/mailx "user@domain.com" -s "Subject here"
Reply With Quote
  #3  
Old 07-07-2008
Registered User
 

Join Date: Jun 2008
Posts: 7
Mail can be sent to ur mailbox by using .

/usr/bin/mailx -s " subject whatever" usermail id

check it out
Reply With Quote
  #4  
Old 07-07-2008
Registered User
 

Join Date: Apr 2008
Posts: 39
Hi
i managed to attached the file using this command :
uuencode /ek_bkup/alert/tbspace_datafile.log tbspace_datafile.log | mailx -r oraadm@juwpkl.gov.my -s\
"Oracle Tspace and Datafile Update" adzuan@nc.com.my

BUT after i download the file attached to my email, the tbspace_datafile.log is not being recognize. The file cant be read although i'm using context, wordpad or notepad...

Anybody can update this??
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0