On Fri, 8 Jul 2011, Kenneth Porter wrote:
To: CentOS mailing list centos@centos.org From: Kenneth Porter shiva@sewingwitch.com Subject: [CentOS] Triggering script from cron or web client
I have a Bash script, currently run a couple times an hour from cron, that pulls data from an old Windows DB by rsync, converts it to SQL, and injects it into a MySQL DB for display in a LAMP-based app. (Make and Perl are also involved to minimize the number of tables touched and to clean up the SQL generated by Pxlib.)
I'd like to add the ability to refresh the data immediately from the web app, but I don't want it to trample on the periodic script and corrupt the data.
I figure the ideal way to do this is to run the script in a loop in its own process, waiting on a semaphore that times out at the refresh period, and poke the semaphore from the web app to have it run before the next periodic cycle.
Is this something you could do with AJAX?
Keith
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------