diff --git a/src/include/ABHelper.php b/src/include/ABHelper.php index e52d18a..176eee1 100644 --- a/src/include/ABHelper.php +++ b/src/include/ABHelper.php @@ -390,6 +390,11 @@ public static function backupContainer($container, $destination) { $tarVerifyOptions = array_merge($tarExcludes, ['--diff']); // Add excludes to the beginning - https://unix.stackexchange.com/a/33334 $tarOptions = array_merge($tarExcludes, ['-c', '-P']); // Add excludes to the beginning - https://unix.stackexchange.com/a/33334 + if ($abSettings->ignoreExclusionCase == 'yes') { + $tarOptions[] = '--ignore-case'; + $tarVerifyOptions[] = '--ignore-case'; + } + switch ($abSettings->compression) { case 'yes': $tarOptions[] = '-z'; // GZip @@ -414,22 +419,35 @@ 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); if ($resultcode > 0) { self::backupLog("tar creation failed! Tar said: " . implode('; ', $output), $containerSettings['ignoreBackupErrors'] == 'yes' ? self::LOGLEVEL_INFO : self::LOGLEVEL_ERR); + + /** + * Special debug: The creation was ok but verification failed: Something is accessing docker files! List docker info for this container + */ + foreach ($volumes as $volume) { + $output = null; + exec("lsof -nl +D " . escapeshellarg($volume), $output); + self::backupLog("lsof($volume)" . PHP_EOL . print_r($output, true), self::LOGLEVEL_DEBUG); + } + 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); @@ -455,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); diff --git a/src/include/ABSettings.php b/src/include/ABSettings.php index 7618bb8..6926c10 100644 --- a/src/include/ABSettings.php +++ b/src/include/ABSettings.php @@ -78,6 +78,7 @@ class ABSettings { public string $backupVMMeta = 'yes'; public string $successLogWanted = 'no'; public string $updateLogWanted = 'no'; + public string $ignoreExclusionCase = 'no'; public function __construct() { diff --git a/src/pages/content/settings.php b/src/pages/content/settings.php index 6a8a24d..97ef13c 100644 --- a/src/pages/content/settings.php +++ b/src/pages/content/settings.php @@ -422,6 +422,18 @@ +
+
Enable --ignore-case for + tar?
This ignores case sensitivity for exclusions. +
+
+
+
+ @@ -593,10 +605,20 @@ class="fa fa-clock-o title">Notifications and scheduling $containerExcludes = implode("\r\n", $containerSetting['exclude']); echo << +.containerSettingsDt { + overflow: hidden; + white-space: nowrap +} +.containerSettingsDt:after { + opacity: 0.1; + content: " _____________________________________________________________________________________________________________________________________________________________________"; +} +
-
pic {$container['Name']}$plexContainerNameSuffix
-
+
pic {$container['Name']}$plexContainerNameSuffix
+