How do I refresh mysql queries every X-minutes.

I am using php to refresh oracle data to a mysql database, that part is fairly smooth.  I need a way to run this code every 15 minutes.  I do not have to have the refresh run on a website, and would prefer to do this through an application (ex. Java).  Does anyone know the best way, or best programming language to do the following that could be automated?

Currently I  query an Oracle database, send info to Mysql database (currently using php via an intranet website to send to txt file, then using DATA FILE  INLOAD to write to mysql.  
qbonepManagerAsked:
Who is Participating?
 
Richard DavisSenior Web DeveloperCommented:
If you're running on a Unix server...just create a cron job that fires every 15 minutes and calls a PHP script at the time it fires.

If you're running windows...set up a Scheduled Task in the control panel that does the same thing.

Always check that your permissions are okay in either case and since you're executing something that does not need to be ran from a UI...then just store that file outside of public web space and security shouldn't be of too great of a concern.

Hope this helped. :)

~A~
0
 
shobinsunCommented:
Hi,

try with this :

At the end of your page, add:

<script language="javascript">
window.setTimeout("self.location.href='<?=$PHP_SELF ?>'", 60000);
</script>  

(For one minute)


Hope this will help you.

Regards
0
 
qbonepManagerAuthor Commented:
Ok, that should be fine to run in a webpage, but these queries may take up to 5 minutes to refresh.   I would rather get away from a webpage if possible.  Is there another way to go about this?  I think the possibility of a webpage crashing out is too unreliable.  Is it even possible to use another application to refresh the oracle query and dump to mysql?
0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
Richard DavisSenior Web DeveloperCommented:
qbonep, my comment was a server-side solution that will run 24/7 and does not require running out of a web page. Did you not understand my suggestion, perhaps?

~A~
0
 
qbonepManagerAuthor Commented:
ok.  sorry it took so long to get back.  So run the cron job using php....  I'll give that a try.  Do you have any good links as an example?
0
 
Richard DavisSenior Web DeveloperCommented:
What shobinson sent you would be a great example. I would highly recommend the first link. It actually shows using a PHP script as the target of a scheduled task via the cron system.

~A~
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.