Jump to content

automatic backup script


kkroo

Recommended Posts

i have a automatic backup script for phpBB
this dude who has my script is getting blank backups, i got access to the script on his server and saw that i can echo the data but not put it into variables, u know what might cause this?
ive been working with it for like 3 hours, i am out of ideas
and anything after defining the variable in the script it cut off
and there are no syntax or fatal errors
could this be with mod interference? the same exact code works on a fresh install of phpBB on the same server

here is where the script screws up:

            //
            // Build the sql script file...
            //
            $backup = "#\n";
            $backup .= "# Automatic phpBB Backup Script\n";
            $backup .= "#\n";
            $backup .= "# Dump of tables for $dbname\n";
            $backup .= "#\n# DATE : " .  gmdate("d-m-Y H:i:s", $time) . " GMT\n";
            $backup .= "#\n";
            $backup .= "\n";


            for($i = 0; $i < count($tables); $i++)
            {
                $table_name = $tables[$i];

                switch (SQL_LAYER)
                {
                    case 'postgresql':
                        $table_def_function = "get_table_def_postgresql";
                        $table_content_function = "get_table_content_postgresql";
                        break;

                    case 'mysql':
                    case 'mysql4':
                        $table_def_function = "get_table_def_mysql";
                        $table_content_function = "get_table_content_mysql";
                        break;
                }
                if ( !empty($table_name) )
                {
                    if($backup_type != 'data')
                    {
                        $backup .= "#\n# TABLE: " . $table_name . "\n#\n";
                        $backup .= $table_def_function($table_name, "\n") . "\n";
                    }
                    
                    if($backup_type != 'structure')
                    {
                        $backup .= $table_content_function($table_name, "output_table_content");
                    }
                }
            }



if i change the part were it defines $backup it to
Link to comment
Share on other sites

I can echo $backup after here

            $backup = "#\n";
            $backup .= "# Automatic phpBB Backup Script\n";
            $backup .= "#\n";
            $backup .= "# Dump of tables for $dbname\n";
            $backup .= "#\n# DATE : " .  gmdate("d-m-Y H:i:s", $time) . " GMT\n";
            $backup .= "#\n";
            $backup .= "\n";



but not after here
Link to comment
Share on other sites

alright, i got that error done with. now there is another error, it gzips the data and saves it to a directory name backups. I open the file and it is 0 bytes. but in the script i echo filesize(filename) and it returns 811632. Why is this happening?

NVM solved
Link to comment
Share on other sites

  • 17 years later...
12 hours ago, kkroo1 said:

Original poster here, many years later. Lost account access. Can a moderator or admin delete this thread?

We don't delete threads, as per the TOS you agree to when you join.

I removed the things in the script code that has PII in them.

Link to comment
Share on other sites

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.