diff --git a/source/ca.backup2/usr/local/emhttp/plugins/ca.backup2/scripts/backup.php b/source/ca.backup2/usr/local/emhttp/plugins/ca.backup2/scripts/backup.php index 2c6c3fe..89693a1 100644 --- a/source/ca.backup2/usr/local/emhttp/plugins/ca.backup2/scripts/backup.php +++ b/source/ca.backup2/usr/local/emhttp/plugins/ca.backup2/scripts/backup.php @@ -147,9 +147,6 @@ function backupLog($msg, $newLine = true, $skipDate = false) } else { backupLog("Not stopping {$docker['Name']}: Not started! [{$docker['Paused']} / {$docker['Status']}]"); - backupLog("DEBUG-INFO while this happened:"); - $res = shell_exec("docker ps -a"); - backupLog($res ); } } } @@ -351,6 +348,23 @@ function backupLog($msg, $newLine = true, $skipDate = false) backupLog("Starting $docker... (try #$dockerStartTry) ", false); $dockerStartCode = $dockerClient->startContainer($docker); if ($dockerStartCode != 1) { + if($dockerStartCode == "Container already started") { + backupLog("Hmm - container is already started! DEBUG Info following...", true, true); + foreach ($dockerRunning as $runningContainer) { + if($runningContainer['Name'] == $docker) { + backupLog("BEFORE backing up container status: ".json_encode($runningContainer)); + $nowRunning = $dockerClient->getDockerContainers(); + foreach ($nowRunning as $nowRunningContainer) { + if($nowRunningContainer["Name"] == $docker) { + backupLog("AFTER backing up container status: ".json_encode($nowRunningContainer)); + } + } + } + } + $dockerContainerStarted = true; + continue; + } + backupLog("Error while starting container! - Code: " . $dockerStartCode, true, true); if ($dockerStartTry < 3) { $dockerStartTry++;