function handleKillAction($args) { if (!isset($args[2]) || !is_numeric($args[2])) { echo "Error: Expected a numeric Job ID as a parameter but did not get one.\n\n"; return; } $jobGetter = new backupJobGetter(); $jobGetter->setLogStream($this->log); if (!($job = $jobGetter->getById($args[2], false))) { throw new ProcessingException("Error: Unable to find a Backup Job with ID " . $args[2] . "."); } if ($job->isRunning()) { $job->setKilled(true); echo "Action: Backup Job ID " . $args[2] . " was killed.\n\n"; } else { echo "Error: The Backup Job with ID " . $args[2] . " is not running.\n\n"; } return; }