mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
🚸 improves backup/check-backup
* backup.php now handles calls from datamodels (approot) * fix check-backup sample cli * better error on check-backup invalid check_ticket_itop cli parameter
This commit is contained in:
@@ -15,7 +15,17 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
|
||||
if (!defined('APPROOT')) require_once(__DIR__.'/../../approot.inc.php');
|
||||
if (!defined('APPROOT'))
|
||||
{
|
||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||
{
|
||||
require_once __DIR__.'/../../approot.inc.php'; // When in env-xxxx folder
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once __DIR__.'/../../../approot.inc.php'; // When in datamodels/x.x folder
|
||||
}
|
||||
}
|
||||
require_once(APPROOT.'application/application.inc.php');
|
||||
require_once(APPROOT.'application/webpage.class.inc.php');
|
||||
require_once(APPROOT.'application/csvpage.class.inc.php');
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// Duplicated code: sys_get_temp_dir, the computation of the target filename, etc.
|
||||
|
||||
// Recommended usage in CRON
|
||||
// /usr/bin/php -q /var/www/combodo/modules/itop-backup/backup.php --backup_file=/home/backups/combodo-crm-%Y-%m-%d
|
||||
// /usr/bin/php -q /var/www/combodo/modules/itop-backup/check-backup.php --backup_file=/home/backups/combodo-crm-%Y-%m-%d
|
||||
// Do not forget to set the 'itop_backup_incident' configuration file parameter !
|
||||
|
||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||
@@ -249,7 +249,7 @@ catch(Exception $e)
|
||||
$sItopRootParam = utils::ReadParam('check_ticket_itop', null, true, 'raw_data');
|
||||
if (!empty($sItopRootParam))
|
||||
{
|
||||
echo 'ERROR: parameter \'check_ticket_itop\' should now be specified in the config file\n';
|
||||
echo "ERROR: parameter 'check_ticket_itop' should now be specified in the config file 'itop_backup_incident' parameter\n";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user