Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Dear all,
i can make a sql connection to db with sqlplus
and after i connect, i write a query. i want to make a script to get this query result in every 2 hour.
Wrap your query in a shell script, pipe your query output to a file, have your script fire up an email client to send and email as you require with that file attached.
If the output is small, you can html wrap it and make it part of the body of the email. How useful this is might depend partly upon what email client you READ it in, so testing your solution should include reading tests with any different clients you might use.
Wrap your query in a shell script, pipe your query output to a file, have your script fire up an email client to send and email as you require with that file attached.
If the output is small, you can html wrap it and make it part of the body of the email. How useful this is might depend partly upon what email client you READ it in, so testing your solution should include reading tests with any different clients you might use.
hi there, thank you for the answer.
i only want to connect sql by sqlplus ***/***@10.200.200.200:1561/ser
and then i want to run this command : select * from SESSION;
and i only want to send the output of this query result by mail. thats all i want.
it worked, i got the result as an output. only i want this output to send me by mail every 2 hour. only i couldnt do that.
Then consult your previous threads where you have examples of both sending emails and using cron!
You should also read and understand all of the following, but especially the emphasized parts:
Quote:
Originally Posted by https://www.linuxquestions.org/questions/faq.php?faq=welcome
Hello and welcome to LQ. You were pointed here because a fellow LQ member feels the thread you started doesn't meet the minimum threshold that would enable us to help you. We understand that Linux can be intimidating for new members, and we really do want to help. That said, please understand that LQ is not a help desk, customer service line for a product you purchased or willing to do your homework (although we are happy to assist you with specifics, if you show some effort of your own!). We're a 100% volunteer organization that wants to help you help yourself.
Here are a couple tips that will enable us to help you moving forward:
When asking a question, be sure to provide as many relevant details as possible. You should include the distribution and version you're using, along with hardware details, application version and exact error messages where applicable.
Using a descriptive title will vastly increase the number of members who see your thread, and therefore make a response significantly more likely. If you're actively troubleshooting an issue you should also include any steps you've already taken.
You may want to include how what you are experiencing differs from what you expected to experience.
Before posting, have you used the search function to ensure your question hasn't been asked before?
You can edit your post by clicking the EDIT button in the bottom right corner of your message.
If you are unwilling or unable to ask questions in a manner that allows us to help you, it's unlikely our community will be able to provide you a solution. Unfortunately, serial offenders who show wanton disregard for this request after multiple pointers may be asked to seek help elsewhere. We truly hope that isn't necessary, and assure you Linux and Open Source are extremely rewarding and well worth the learning curve in the long run.
Basically, this runs your code in a sub-shell, whose o/p is captured and sent as the body of an email with subject you specify in quotes, then your email.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.