Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Executing another php file

littlescripterSep 13 2011 — edited Sep 27 2011
Hi

I am new to php programming
As part of one activity I new to schedule below three php files from cronjob at 10,11,12PM respectively

0 10 * * * php -q /home/produsr/newtask22/gather.php
0 11 * * * php -q /home/produsr/newtask22/upload.php
0 12 * * * php -q /home/produsr/newtask22/report.php
Now due to some issue by scheduling 3 cron jobs, I need to run above three php files from one php like

#start newtask22
execute php -q /home/produsr/newtask22/gather.php
sleep 1hour #
execute php -q /home/produsr/newtask22/upload.php
sleep 1hour
execute php -q /home/produsr/newtask22/report.php
#end newtask22
Please let me know how to do so in php

I tried and wrote below script but not sure whether its right or not
<?php
    exec("php -q /home/produsr/newtask22/gather.php");
    sleep(3600);
    exec("php -q /home/produsr/newtask22/upload.php");
    sleep(3600);
    exec("php -q /home/produsr/newtask22/report.php");
?> 
Please correct my code :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2011
Added on Sep 13 2011
2 comments
509 views