Skip to content

Commit

Permalink
Added duration for every backup and (if enabled) verification. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Sep 6, 2024
1 parent fbf9f4d commit 096bf3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/include/ABHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ public static function backupContainer($container, $destination) {
self::backupLog("Generated tar command: " . $finalTarOptions, self::LOGLEVEL_DEBUG);
self::backupLog("Backing up " . $container['Name'] . '...');

$tarBackupTimer = time();

$output = $resultcode = null;
exec("tar " . $finalTarOptions . " 2>&1 " . ABSettings::$externalCmdPidCapture, $output, $resultcode);
self::backupLog("Tar out: " . implode('; ', $output), self::LOGLEVEL_DEBUG);
Expand All @@ -438,13 +440,14 @@ public static function backupContainer($container, $destination) {
return $containerSettings['ignoreBackupErrors'] == 'yes';
}

self::backupLog("Backup created without issues");
self::backupLog("Backup created without issues (took " . gmdate("H:i:s", time() - $tarBackupTimer) . " (hours:mins:secs))");

if (self::abortRequested()) {
return true;
}

if ($containerSettings['verifyBackup'] == 'yes') {
$tarVerifyTimer = time();
self::backupLog("Verifying backup...");
self::backupLog("Final verify command: " . $finalTarVerifyOptions, self::LOGLEVEL_DEBUG);

Expand All @@ -470,6 +473,8 @@ public static function backupContainer($container, $destination) {
}
}
return $containerSettings['ignoreBackupErrors'] == 'yes';
} else {
self::backupLog("Verification ended without issues (took " . gmdate("H:i:s", time() - $tarVerifyTimer) . " (hours:mins:secs))");
}
} else {
self::backupLog("Skipping verification for this container because its not wanted!", self::LOGLEVEL_WARN);
Expand Down

0 comments on commit 096bf3f

Please sign in to comment.