LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-14-2001, 09:34 PM   #1
ehsan
LQ Newbie
 
Registered: Mar 2001
Location: St. Louis
Posts: 17

Rep: Reputation: 0
Angry


Is it possible to use cron to run an sql query every hour(or script)on mySql and send email using sendmail if certain criteria is met. If somebody can help me with an example I will greatly appreciate it. I am new to Linux.
 
Old 03-14-2001, 10:04 PM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
The easiest way to do this would be to have cron run a perl script every hour. You could then have the perl script do the SQL query and handle the mailing of output. If you do a search on the forum you will find a few examples showing how to connect to a MySQL database with perl.
 
Old 03-14-2001, 10:50 PM   #3
ehsan
LQ Newbie
 
Registered: Mar 2001
Location: St. Louis
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you very jeremy. This site is the greatest on the net.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make cron not send email? bbeers Slackware 7 11-11-2005 10:31 AM
SQL Query question oulevon Programming 7 01-16-2004 01:50 AM
usin AWK in cron job to send dynamic ip via email digihlp Programming 2 12-10-2003 08:10 AM
Cron job , send email mikeshn Linux - General 1 09-21-2003 09:02 AM
Send Email + Txt Attachment Using Cron Job beringer Linux - Newbie 3 01-31-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration