Newer
Older
backup-commander / html / bin / run-bu-by-id.php
<?php

include_once __DIR__.'/../inc/bu-common.php';

// NOTE:
// php.ini requires register_argc_argv = On

// $argv[0] => the name/path of this script
$id = $argv[1];
$isTest = $argv[2];

$str_err = run_backup_block( $id, $isTest=='1' );

/*
 * Since this script is used from within the shell, we loose return values. Therefore, any error
 * recieved from the previous call will be echoed to the console. It shall have the string
 * "Error:" prepended.
 * 
 * The shell exec will pickup the echoed output and test for the "Error" string.
 * 
 * The output is silent if all went well.
 */
if($str_err!='') echo "Error: $str_err";

?>