Skip to content

Commit

Permalink
Fix options detection in backup
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 17, 2024
1 parent 37b8df9 commit a480d7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/batch_customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
// Global variables
$FORCE=0;
$NOSTATS=0;
$keystocheck = array(3, 3, 4);
$keystocheck = array(2, 3, 4);
foreach ($keystocheck as $keytocheck) {
if (isset($argv[$keytocheck])) {
if ($argv[$keytocheck] == '--force') {
Expand Down Expand Up @@ -210,7 +210,7 @@
}

// Set serverprice with the param from $conf of the $dbmaster server.
$serverprice = empty($conf->global->SELLYOURSAAS_INFRA_COST) ? '100' : $conf->global->SELLYOURSAAS_INFRA_COST;
$serverprice = getDolGlobalInt('SELLYOURSAAS_INFRA_COST', 100);

//$langs->setDefaultLang('en_US'); // To change default language of $langs
$langs->load("main"); // To load language file for default language
Expand Down Expand Up @@ -275,7 +275,7 @@
$instancesbackupsuccessdiscarded=array();


$instancefilter=(isset($argv[2]) ? $argv[2] : '');
$instancefilter=((isset($argv[2]) && !in_array($argv[2], array('--force', '--nostats'))) ? $argv[2] : '');
$instancefiltercomplete=$instancefilter;

// Forge complete name of instance
Expand Down Expand Up @@ -506,12 +506,12 @@
if (! $error) {
$nbofok++;
$instancesbackupsuccess[$instance] = array('date' => dol_now('gmt'));
print '-> Backup process success for '.$instance."\n";
print '-> Backup process success for '.$instance."\n\n";
sleep(2); // On success, we wait 2 seconds
} else {
$nboferrors++;
$instancesbackuperror[$instance] = array('date' => dol_now('gmt'));
print '-> Backup process fails for '.$instance."\n";
print '-> Backup process fails for '.$instance."\n\n";
sleep(5); // On error, we wait 5 seconds
}
}
Expand Down

0 comments on commit a480d7c

Please sign in to comment.