Ticket #5907 (closed Bugs: fixed)

Opened 1 year ago

Last modified 9 months ago

Bug script backup.php

Reported by: bmerindol Assigned to:
Priority: minor Milestone: 2.11
Component: Backup & Restore Version: 2.10-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description (Last modified by mbrevda)

Hi, On script backup.php in modules/backup/bin it have bug on restaure or dump just ASTDB


} elseif(isset($var['astdb']) && $var['astdb']) {
        switch ($var['astdb']) {
                case 'dump':
                        echo astdb_get(array('RG', 'BLKVM', 'FM', 'dundi'));
                        break;
                case 'restore':
                        if (is_file($data)) {
                                $data = file_get_contents($data);
                        }
                        astdb_put(unserialize($data), array('RINGGROUP', 'BLKVM', 'FM', 'dundi'));
                        break;

} elseif(isset($vars['astdb']) && $vars['astdb']) {
        switch ($vars['astdb']) {
                case 'dump':
                        echo astdb_get(array('RG', 'BLKVM', 'FM', 'dundi'));
                        break;
                case 'restore':
                         $data=vars['$data'];
                        if (is_file($data)) {
                                $data = file_get_contents($data);
                        }
                        astdb_put(unserialize($data), array('RINGGROUP', 'BLKVM', 'FM', 'dundi'));
                        break;

Best regards Bernard

Attachments

backup.php.patch (0.5 kB) - added by bmerindol on 07/08/12 09:50:27.
The patch file

Change History

07/02/12 06:16:09 changed by bmerindol

Sorry but the HTML render is very bad.

change $var by $vars and add :

} elseif(isset($vars['astdb']) && $vars['astdb']) {
        switch ($vars['astdb']) {
                case 'dump':
                        echo astdb_get(array('RG', 'BLKVM', 'FM', 'dundi'));
                        break;
                case 'restore':
                       $date=$vars['data'];
                        if (is_file($data)) {
                                $data = file_get_contents($data);
                        }
                        astdb_put(unserialize($data), array('RINGGROUP', 'BLKVM', 'FM', 'dundi'));
                        break;

(follow-up: ↓ 3 ) 07/02/12 06:23:08 changed by mbrevda

  • description changed.

Please explain whats broken, what you've fixed, and attach a unified diff file.

07/08/12 09:50:27 changed by bmerindol

  • attachment backup.php.patch added.

The patch file

(in reply to: ↑ 2 ) 07/08/12 09:50:45 changed by bmerindol

Replying to mbrevda:

Please explain whats broken, what you've fixed, and attach a unified diff file.

When you try to restore or dump just ASTDB with this scripts is not works.

The option is passed in $vars Array ($vars = $getopt($short = , $long = array('opts::', 'id::', 'astdb::', 'data::'));) But in part on ASTDB the scripts test $var. I have fixed this type errors ? The second errors is use $data variable but is not initialized I initialize by $date=$varsdata?;

Attach the patch

(follow-up: ↓ 5 ) 07/09/12 07:56:13 changed by mbrevda

(In [14231]) re #5907 - I think this is what you mean? Please confirm so that we can publish

(in reply to: ↑ 4 ) 07/09/12 11:44:30 changed by bmerindol

Replying to mbrevda:

(In [14231]) re #5907 - I think this is what you mean? Please confirm so that we can publish

Is good for me. Best regards Bernard

07/09/12 11:52:42 changed by mbrevda

(In [14232]) [Auto Checking in outstanding changes in backup] re #5907 - fix astdb backup/restore commands

07/09/12 11:52:44 changed by mbrevda

(In [14233]) [Module package script: backup 2.10.0.29] re #5907 - fix astdb backup/restore commands

07/09/12 11:52:47 changed by mbrevda

(In [14234]) [Module package script: backup 2.10.0.29] re #5907 - fix astdb backup/restore commands

09/25/12 05:29:28 changed by mbrevda

  • status changed from new to closed.
  • resolution set to fixed.