Newer
Older
backup-commander / html / bin / run-bu-by-id.php
  1. <?php
  2.  
  3. include_once __DIR__.'/../inc/paths.php';
  4. include_once __DIR__.'/../inc/bu-common.php';
  5.  
  6. // NOTE:
  7. // php.ini requires register_argc_argv = On
  8.  
  9. // $argv[0] => the name/path of this script
  10. $id = $argv[1];
  11. $isTest = $argv[2];
  12.  
  13. $str_err = run_backup_block( $id, $isTest=='1' );
  14.  
  15. /*
  16. * Since this script is used from within the shell, we loose return values. Therefore, any error
  17. * recieved from the previous call will be echoed to the console. It shall have the string
  18. * "Error:" prepended.
  19. *
  20. * The shell exec will pickup the echoed output and test for the "Error" string.
  21. *
  22. * The output is silent if all went well.
  23. */
  24. if($str_err!='') echo "Error: $str_err";
  25.  
  26. ?>