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
shell script to send email with usage of space in the directory as description : sakthifire Shell Programming and Scripting 3 04-18-2008 05:27 AM
need help in finding a string and to send an email using shell script ranga27 Shell Programming and Scripting 10 02-19-2008 05:54 PM
How to write a shell script to send an email to an id madhumathikv Shell Programming and Scripting 4 10-23-2007 06:19 PM
need help: how to send email with HIGH priority in shell scripts? _joshua_ Shell Programming and Scripting 2 03-13-2007 01:34 AM
Shell script to send email alert for core dump rtatineni SUN Solaris 1 08-17-2006 03:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-25-2002
cub cub is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chicago
Posts: 8
Red face Shell to run query, encrypt and send email

Hello

To do :

'automate the process of generating report and send it to client every 15 days after encrypting the report file'

Did so far :

- generate Java program to encrypt the file.
- generate SQL query to run the report.

Is there any body who can help me to go further ?

Thanks in advance.
  #2 (permalink)  
Old 06-25-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
If you do a search of 'attach' and 'mail' on this site, there have been many suggestions on attaching files to an email. That should take care of your last step.

(You need to do it this way since you are encrypting and sending a file - I don't believe just 'mailx -s"test" joeuser@mycom.com < /myfile' would work)
  #3 (permalink)  
Old 06-25-2002
cub cub is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chicago
Posts: 8
Arrow but for remaining.....

thanks for your reply.

You are right. I need to ecrypt the file first and then I can send an email with attachment. I have kind of figured out about that email attachment part but need help with other parts of the problem.

I'm thinking to use following syntax after encryption of file to send an email:

.uuencode /dir1/dir2/temp.file attachment.file | mailx -s "Sending information..." abc@xyz.com

Any help will be appreciated
  #4 (permalink)  
Old 06-27-2002
cub cub is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chicago
Posts: 8
Smile conditions

I'm able to do all these three parts - run query, encrypt the file & send email within in a shell.

Now, I need help for generating checkpoints........ that means, need to put condition to check successful completion of query before encryption as well as to check successful completion of encryption before email part.

*** Please dispose your thoughts, if you have any. ***

Thanks
  #5 (permalink)  
Old 06-27-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
If the main script is ksh or sh, then you can check for the exit status of the called program.

status=`echo $?`

This is assuming that you write a script to do these three parts.
In java I'm sure it has a way of breaking out on error and setting the exit value to non-successful.
  #6 (permalink)  
Old 06-27-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Using && at the end of commands will mean that only if that command is successful move on to the next one...can be useful.
  #7 (permalink)  
Old 07-10-2002
cub cub is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chicago
Posts: 8
Question ...problem with email attachment

thank you - peter.herlihy & RTM for your response.

peter.herlihy -> It seems like '&&' is not working with my program.

RTM -> status=`echo $?` is working fine.

So, the problem I posted here has been resolved partially now because...

I was using my own company email id to test automated email generation with attached fine and it was working fine. Now, I find out that if I use my external email (like yahoo), attached file is being sent as a body of an email. Currently, I'm using...

uuencode /export/DATA_DIR/encrypted.file attachment.file | mailx -s "Schedule file delivery" myname@company.com

I have no authority or access to download anything on UNIX box. Is there anything else (which is in built) I can use or any syntax change ???

I'm very greatful to the people who are giving their valuable time here.
Closed Thread

Bookmarks

Tags
mailx, mailx attachment

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0