Jump to content

include() question


realjumper

Recommended Posts

Hi,

 

I have a script to backup  a particular database. If I create another instance of this script I can backup a different database, and so on. If I have (say) 10 databases to backup, I would have to create 10 instances of this script. That's not the problem. The problem is that rather than create 10 cron jobs, I would like to have one file call the 10 scripts, with a 30 second interval between them. Then I would only need one cron job. Is there a way to have one script call other scripts? I have tried variations on the code below, but only the first script gets called.

 


<?php

include_once "backup_scripts/execute_db1_backup.php";

sleep(30);

include_once "backup_scripts/execute_db2_backup.php";

?>

Link to comment
https://forums.phpfreaks.com/topic/50432-include-question/
Share on other sites

Because if I include the two files, there are some function names in those two files that are the same, but do different tasks because they are for different databases. So I guess there is confusion in the script as to which function I am trying to call...because they both have the same name...._I think!_

Link to comment
https://forums.phpfreaks.com/topic/50432-include-question/#findComment-247775
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.