Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.