diff --git a/yeswiki-updater.php b/yeswiki-updater.php index 8ea885c..c6ee83f 100755 --- a/yeswiki-updater.php +++ b/yeswiki-updater.php @@ -39,6 +39,12 @@ if ($isRoot) { 'description' => 'Update to latest version of stable yeswiki', 'noValue' => true ], + 'backup' => [ + 'prefix' => 'b', + 'longPrefix' => 'backup', + 'description' => 'Save a backup in /root/yeswiki_backups folder before upgrading the yeswiki', + 'defaultValue' => true + ], 'depth' => [ 'prefix' => 'd', 'longPrefix' => 'depth', @@ -60,6 +66,7 @@ if ($isRoot) { try { $update = $climate->arguments->get('update'); $output = $climate->arguments->get('output'); + $backup = $climate->arguments->get('backup'); $depth = $climate->arguments->get('depth'); $matches = searchWikis($path, 'wakka.config.php', $depth); if (count($matches) == 0) { @@ -87,11 +94,10 @@ if ($isRoot) { } elseif ($wiki['RELEASE'] == $version) { $climate->info('Skipping up-to-date wiki '.$wiki['URL']); } else { - $climate->info(upgradeWiki($destDir, $wiki['PATH'])); + $climate->info(upgradeWiki($destDir, $wiki['PATH'], $backup)); } } } else { // show yeswiki list info - $climate->info(count($matches) . ' yeswikis found on ' . $path); switch ($output) { case 'table':