Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Feb 6, 2024
1 parent 701e13d commit 61cc998
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions src/include/ABHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,17 @@ public static function stopContainer($container) {
global $dockerClient, $abSettings;

$containerSettings = $abSettings->getContainerSpecificSettings($container['Name']);
if ($containerSettings['dontStop'] == 'yes') {
self::backupLog("NOT stopping " . $container['Name'] . " because it should be backed up WITHOUT stopping!", self::LOGLEVEL_WARN);
self::$skipStartContainers[] = $container['Name'];
return true;
}


if ($container['Running'] && !$container['Paused']) {
self::backupLog("Stopping " . $container['Name'] . "... ", self::LOGLEVEL_INFO, false);

if ($containerSettings['dontStop'] == 'yes') {
self::backupLog("NOT stopping " . $container['Name'] . " because it should be backed up WITHOUT stopping!", self::LOGLEVEL_WARN);
self::$skipStartContainers[] = $container['Name'];
return true;
}

$stopTimer = time();
$dockerStopCode = $dockerClient->stopContainer($container['Name']);
if ($dockerStopCode != 1) {
Expand Down Expand Up @@ -513,7 +516,7 @@ public static function getContainerVolumes($container) {
continue;
}
if (in_array($hostPath, $abSettings->allowedSources)) {
self::backupLog("Removing container mapping \"$hostPath\" because it is a source path!");
self::backupLog("Removing container mapping \"$hostPath\" because it is a source path (exact match)!");
continue;
}
$volumes[] = $hostPath;
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@
ABHelper::backupLog("Backup cancelled! Executing final things. You will be left behind with the current state!", ABHelper::LOGLEVEL_WARN);
}

ABHelper::handlePrePostScript($abSettings->postRunScript, 'post-run', $abDestination, ($errorOccured ? 'false' : 'true'));

ABHelper::backupLog("DONE! Thanks for using this plugin and have a safe day ;)");
ABHelper::backupLog("❤️");

Expand All @@ -374,4 +372,6 @@
}
unlink(ABSettings::$tempFolder . '/' . ABSettings::$stateFileScriptRunning);

ABHelper::handlePrePostScript($abSettings->postRunScript, 'post-run', $abDestination, (ABHelper::$errorOccured ? 'false' : 'true'));
ABHelper::handlePrePostScript($abSettings->postRunScript, 'post-run', $abDestination, (ABHelper::$errorOccured ? 'false' : 'true'));

exit(ABHelper::$errorOccured ? 1 : 0);

0 comments on commit 61cc998

Please sign in to comment.