if ($status == JobStatus::$FINISHED || $status === JobStatus::$KILLED) { if ($precstatus !== $status) { $jobinfo['status'] = $status; // get_job_status returned FINISHED or KILLED, we save that info in the job JSON save_job_info($file, $job, $jobinfo); } if (!isset($jobinfo["usedspace"])) { // calculate space used by temp dir + results $usedspace = get_job_disk_usage(OC_User::getUser(), $file, $job); if (!$usedspace) { $usedspace = "--"; } $jobinfo['usedspace'] = $usedspace; // get_job_status returned FINISHED or KILLED, we save that info in the job JSON save_job_info($file, $job, $jobinfo); insert_job_log($file, $job, "{$status}. Used disk space: {$usedspace}"); } } elseif ($status === JobStatus::$UNKNOWN) { $jobinfo['status'] = $status; save_job_info($file, $job, $jobinfo); } else { /* Job is RUNNING */ $queueinfo = get_queue_info($qsub_jobname); $sgequeued = $queueinfo[0]; $sgerunning = $queueinfo[1]; } $showoutputjs = "javascript:show_output('" . $outputid . "', '" . $output_file . "')"; $killjs = OC_Helper::linkTo("neurocloud", "ajax/kill_job.php", array("study" => $file, "jobid" => $job, "redirect" => 1)); $refreshstatusjs = "javascript:refresh_job_status('" . $rowid . "','" . $file . "','" . $job . "','" . $outputid . "')"; $showjobinfojs = "javascript:show_output('" . $outputid . "','" . get_job_info_file($file, $job) . "', true)"; #$queueinfojs = "javascript:show_queue_info('" . $outputid . "','". $jobinfo['qsub_jobname'] . "', true)";
<?php /* * delete_results * Created on: Jan 30, 2013 12:30:40 PM * * Copyright 2013 EnginSoft S.p.A. * All rights reserved */ include_once 'neurocloud/lib/common.php'; $study = $_POST["study"]; $jobid = $_POST["jobid"]; $path = "{$study}/results/{$jobid}"; $jobinfo = get_job_info($study, $jobid); $usedspace = isset($jobinfo["usedspace"]) ? $jobinfo["usedspace"] : "undefined"; insert_job_log($study, $jobid, "deleted results. Used disk space: {$usedspace}"); if (\OC\Files\Filesystem::is_dir($path)) { //rmdirr($path); \OC\Files\Filesystem::unlink($path); // from Owncloud 5.0.0, this will recurse on subdirs (delTree) } $execdir = get_job_exec_dir($jobid); if (is_dir($execdir)) { rmdirr($execdir); } exit;