} else {
            $job['compression'] = 'N/A';
        }
        // Job speed
        $start = $job['starttime'];
        $end = $job['endtime'];
        $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
        if ($seconds !== false && $seconds > 0) {
            $speed = $job['jobbytes'] / $seconds;
            $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
        } else {
            $job['speed'] = 'N/A';
        }
        // Job bytes more easy to read
        $job['jobbytes'] = CUtils::Get_Human_Size($job['jobbytes']);
        $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
        $jobs[] = $job;
    }
    // end while
} catch (Exception $e) {
    CErrorHandler::displayError($e);
}
$view->assign('jobs', $jobs);
$view->assign('backupjob_name', $backupjob_name);
$view->assign('backupjob_period', $backupjob_period);
$view->assign('backupjob_bytes', $backupjob_bytes);
$view->assign('backupjob_files', $backupjob_files);
// Set page name
$current_page = 'Backup job report';
$view->assign('page_name', $current_page);
// Process and display the template
Exemple #2
0
 $view->assign('literal_period', strftime("%a %e %b %Y", $custom_period[0]) . ' to ' . strftime("%a %e %b %Y", $custom_period[1]));
 // Running, completed, failed, waiting and canceled jobs status over last 24 hours
 $view->assign('running_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'running'));
 $view->assign('completed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'completed'));
 $view->assign('failed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'failed'));
 $view->assign('waiting_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'waiting'));
 $view->assign('canceled_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'canceled'));
 // Stored files number
 $view->assign('stored_files', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $no_period)));
 // Overall stored bytes
 $view->assign('stored_bytes', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $no_period)));
 // Database size
 $view->assign('database_size', Database_Model::get_Size($dbSql->db_link, $dbSql->catalog_current_id));
 // Total bytes and files stored over the last 24 hours
 $view->assign('bytes_last', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $custom_period)));
 $view->assign('files_last', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $custom_period)));
 // Number of clients
 $view->assign('clients', Clients_Model::count($dbSql->db_link));
 // Defined Jobs and Filesets
 $view->assign('defined_filesets', FileSets_Model::count($dbSql->db_link));
 $view->assign('defined_jobs', Jobs_Model::count_Job_Names($dbSql->db_link));
 // Incremental, Differential and Full jobs over the last 24 hours
 $view->assign('incr_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_INCR));
 $view->assign('diff_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_DIFF));
 $view->assign('full_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_FULL));
 // Volumes disk usage
 $volumes_size = Volumes_Model::getDiskUsage($dbSql->db_link);
 $view->assign('volumes_size', CUtils::Get_Human_Size($volumes_size));
 // Pools count
 $view->assign('pools_nb', Pools_Model::count($dbSql->db_link));
 // Backup Job list