![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 01: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 02:54 PM |
| How to write a shell script to send an email to an id | madhumathikv | Shell Programming and Scripting | 4 | 10-23-2007 02:19 PM |
| need help: how to send email with HIGH priority in shell scripts? | _joshua_ | Shell Programming and Scripting | 2 | 03-12-2007 10:34 PM |
| Shell script to send email alert for core dump | rtatineni | SUN Solaris | 1 | 08-17-2006 11:33 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
Using && at the end of commands will mean that only if that command is successful move on to the next one...can be useful.
__________________
Pete |
|
#7
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |
| Tags |
| mailx, mailx attachment |
| Thread Tools | |
| Display Modes | |
|
|