else\r
die( "Please specify a backup job name " );\r
\r
+ // Generate Backup Job report period string
+ $backupjob_period = "From " . date( "Y-m-d", (NOW-WEEK) ) . " to " . date( "Y-m-d", NOW );
+
+ // Calculate total bytes for this period
+ $backupjob_bytes = $dbSql->getStoredBytes( LAST_WEEK, NOW, $backupjob_name );
+ $backupjob_bytes = CUtils::Get_Human_Size( $backupjob_bytes );
+
// Get the last 7 days interval (start and end)\r
for( $c = 6 ; $c >= 0 ; $c-- ) {\r
$today = NOW - ($c * DAY);
$days[] = CTimeUtils::get_Day_Intervals($today);
}\r
- // Generate Backup Job report period string\r
- $backupjob_period = "From " . date( "Y-m-d", (NOW-WEEK) ) . " to " . date( "Y-m-d", NOW );
-
// ===============================================================
// Last 7 days stored Bytes graph\r
// ===============================================================
$graph = new CGraph( "graph2.png" );
\r
foreach( $days as $day ) {
- $stored_bytes = CUtils::Get_Human_Size( $dbSql->getStoredBytes( $day['start'], $day['end'], $backupjob_name), 1, 'GB', false );
+ $stored_bytes = $dbSql->getStoredBytes( $day['start'], $day['end'], $backupjob_name);
+ $stored_bytes = CUtils::Get_Human_Size( $stored_bytes, 1, 'GB', false );
$days_stored_bytes[] = array( date("m-d", $day['start']), $stored_bytes );
}
- \r
- // Calculate total bytes for this period\r
- $backupjob_bytes = $dbSql->getStoredBytes( LAST_WEEK, NOW, $backupjob_name );
- $backupjob_bytes = CUtils::Get_Human_Size( $backupjob_bytes );
- \r
+
$graph->SetData( $days_stored_bytes, 'bars', 'text-data' );\r
$graph->SetGraphSize( 400, 230 );\r
$graph->SetYTitle( "GB" );