Advertisement

09.09.2008 at 03:23AM PDT, ID: 23714892
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

How to run php files simultaneously via a batch / shell script?

Asked by bibabutze in Bourne-Again Shell (bash), PHP for Windows, Windows Batch Scripting

Tags:

Hello everyone,

I´m working with a "job table" (mysql). In this table you can find different params that are being used for a php-script. This script works on my database and file operations. Every run of this script takes between 1 minute and 30 minutes, depending on the id from the job table. (e.g. jobexecuter.php?jobid=1....jobid=5....jobid=15....). The execution timeout for php scripts has been set to 1 hour. PHP is not working in safe mode. The scripts run in an internal network.

I can work the different scripts manually with my webbrowser and everything works fine so far. So i open the url "jobexecuter.php?jobid=13" with my browser and with another instance of my browser i open the url "jobexecuter.php?jobid=17"... This works fine so far.

My question is:

Is there a way to automate this task? I´m searching for a solution like a bash-script (Windows) as well as a shell-script (unix) that gets the upcoming jobid from the database and passes it on to the batch/shell script like:

php -f jobexecuter.php 15
php -f jobexecuter.php 17
php -f jobexecuter.php 22

The background of my question is that i could call these bash/shell scripts via Tasks (Windows) or a cronjob (unix) and wouldn´t have to do it manually with my browsers.

I could get the IDs from the database  with another php-script, but how can i pass the return-array to the batch/shell script like:
php -f jobexecuter.php X
... with a loop like:

job.bat
[START Pseudocode]
php -f getids.php > Array
foreach (Array as Jobid)
{     php -f jobexecuter.php Jobid
}
[END Pseudocode]

Another very important task is to run those jobexecutive-scripts at the same time... since there are scripts that can take up to 1 hour... and i would like to run couple of scripts at the same time. Is there a way to run the jobexecute-scripts as "child-processes" or another "multithreading" solution? Start Free Trial
[+][-]09.09.2008 at 07:29AM PDT, ID: 22427726

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 07:48AM PDT, ID: 22427953

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 08:27AM PDT, ID: 22428445

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 08:29AM PDT, ID: 22428472

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 09:36AM PDT, ID: 22429273

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 10:04AM PDT, ID: 22429630

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Bourne-Again Shell (bash), PHP for Windows, Windows Batch Scripting
Tags: PHP / Batch / Shell
Sign Up Now!
Solution Provided By: MikeOM_DBA
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628