Ticket #3996 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

Backup 2.6.0.4 doesn't work with backup id from cli

Reported by: GameGamer43 Assigned to: mbrevda
Priority: major Milestone: 2.6
Component: Backup & Restore Version: 2.6-branch
Keywords: Cc:
Confirmation: Confirmed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable): 8464

Description

The new backup module give you the error message that it was not given any agruments when you run it with the backup id. This is caused by redefining the variables we use when we pass it one argument right after we first define them. I've uploaded a patch which should correct this issue and has been tested against running ampbackup.php from the GUI and from the command line.

Please let me know if you have any questions.

Change History

01/03/10 16:45:24 changed by GameGamer43

Index: backup/bin/ampbackup.php =================================================================== --- backup/bin/ampbackup.php (revision 8464) +++ backup/bin/ampbackup.php (working copy) @@ -57,16 +57,16 @@

$optsconfigs?=(isset($resConfigurations?)&& $resConfigurations?=='yes')?true:false; $optscdr?=(isset($resCDR?)&& $resCDR?=='yes')?true:false; $optsfop?=(isset($resFOP?)&& $resFOP?=='yes')?true:false;

+}else {//and finally if this is being run from the GUI + $optsname?=isset($argv[1])?$argv[1]:false; + $optsvoicemail?=(isset($argv[2])&& $argv[2]=='yes')?true:false; + $optsrecordings?=(isset($argv[3])&& $argv[3]=='yes')?true:false; + $optsconfigs?=(isset($argv[4])&& $argv[4]=='yes')?true:false; + $optscdr?=(isset($argv[5])&& $argv[5]=='yes')?true:false; + $optsfop?=(isset($argv[6])&& $argv[6]=='yes')?true:false; + //var_dump($opts);

}

-$optsname?=isset($argv[1])?$argv[1]:false; -$optsvoicemail?=(isset($argv[2])&& $argv[2]=='yes')?true:false; -$optsrecordings?=(isset($argv[3])&& $argv[3]=='yes')?true:false; -$optsconfigs?=(isset($argv[4])&& $argv[4]=='yes')?true:false; -$optscdr?=(isset($argv[5])&& $argv[5]=='yes')?true:false; -$optsfop?=(isset($argv[6])&& $argv[6]=='yes')?true:false; -//var_dump($opts); -

//if all options are set to no/false, return an error if(!$optsvoicemail?&&!$optsrecordings?&&!$optsconfigs?&&!$optscdr?&&!$optsfop?){echo "Backup Error: You need to set at least one option to yes\n";showopts();} system('/bin/rm -rf /tmp/ampbackups.'.$optsnow?.' > /dev/null 2>&1');//remove stale backup

@@ -255,4 +255,4 @@

}

}

}

-?> \ No newline at end of file +?>

01/03/10 16:46:16 changed by GameGamer43

I've uploaded the patch files code as I'm having trouble uploading the patch file itself. The patch file will be uploaded soon though.

01/03/10 16:48:08 changed by GameGamer43

Index: backup/bin/ampbackup.php
===================================================================
--- backup/bin/ampbackup.php    (revision 8464)
+++ backup/bin/ampbackup.php    (working copy)
@@ -57,16 +57,16 @@
        $opts['configs']=(isset($res['Configurations'])&& $res['Configurations']=='yes')?true:false;
        $opts['cdr']=(isset($res['CDR'])&& $res['CDR']=='yes')?true:false;
        $opts['fop']=(isset($res['FOP'])&& $res['FOP']=='yes')?true:false;
+}else {//and finally if this is being run from the GUI
+       $opts['name']=isset($argv[1])?$argv[1]:false;
+       $opts['voicemail']=(isset($argv[2])&& $argv[2]=='yes')?true:false;
+       $opts['recordings']=(isset($argv[3])&& $argv[3]=='yes')?true:false;
+       $opts['configs']=(isset($argv[4])&& $argv[4]=='yes')?true:false;
+       $opts['cdr']=(isset($argv[5])&& $argv[5]=='yes')?true:false;
+       $opts['fop']=(isset($argv[6])&& $argv[6]=='yes')?true:false;
+       //var_dump($opts);
 }

-$opts['name']=isset($argv[1])?$argv[1]:false;
-$opts['voicemail']=(isset($argv[2])&& $argv[2]=='yes')?true:false;
-$opts['recordings']=(isset($argv[3])&& $argv[3]=='yes')?true:false;
-$opts['configs']=(isset($argv[4])&& $argv[4]=='yes')?true:false;
-$opts['cdr']=(isset($argv[5])&& $argv[5]=='yes')?true:false;
-$opts['fop']=(isset($argv[6])&& $argv[6]=='yes')?true:false;
-//var_dump($opts);
-
 //if all options are set to no/false, return an error
 if(!$opts['voicemail']&&!$opts['recordings']&&!$opts['configs']&&!$opts['cdr']&&!$opts['fop']){echo "Backup Error: You need to set at least one option to yes\n";showopts();}
 system('/bin/rm -rf /tmp/ampbackups.'.$opts['now'].' > /dev/null  2>&1');//remove stale backup
@@ -255,4 +255,4 @@
                }
        }
 }
-?>
\ No newline at end of file
+?>

01/04/10 02:08:54 changed by mbrevda

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

(In [8465]) closes #3996

01/05/10 18:58:01 changed by p_lindheimer

(In [8563]) revert r8465, r8455 left in 2.7 for testing re #3996 and re #3982

01/05/10 19:01:59 changed by p_lindheimer

(In [8564]) Blocked revisions 8562-8563 via svnmerge

........

r8562 | p_lindheimer | 2010-01-05 15:54:43 -0800 (Tue, 05 Jan 2010) | 1 line

revert r8461 left in 2.7 where it can be tested, re #3594

........

r8563 | p_lindheimer | 2010-01-05 15:58:00 -0800 (Tue, 05 Jan 2010) | 1 line

revert r8465, r8455 left in 2.7 for testing re #3996 and re #3982

........