From 90c04b362de5046f6d80252348be4ef24a2be717 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Tue, 9 Jul 2024 08:58:26 +0200 Subject: [PATCH 1/6] Support tars `--ignore-case` for exclusions. Fixes #26 --- src/include/ABHelper.php | 5 +++++ src/include/ABSettings.php | 1 + src/pages/content/settings.php | 12 ++++++++++++ src/scripts/backup.php | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/src/include/ABHelper.php b/src/include/ABHelper.php index 0c5d897..49371ce 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 diff --git a/src/include/ABSettings.php b/src/include/ABSettings.php index f0ed701..b886de0 100644 --- a/src/include/ABSettings.php +++ b/src/include/ABSettings.php @@ -76,6 +76,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 7516c02..4cc043b 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. +
+
+
+
+ diff --git a/src/scripts/backup.php b/src/scripts/backup.php index 3fc1577..c1d05fb 100644 --- a/src/scripts/backup.php +++ b/src/scripts/backup.php @@ -263,6 +263,10 @@ $tarOptions = array_merge($tarExcludes, ['-c', '-P']); // Add excludes to the beginning - https://unix.stackexchange.com/a/33334 + if ($abSettings->ignoreExclusionCase == 'yes') { + $tarOptions[] = '--ignore-case'; + } + $destination = $abDestination . '/extra_files.tar'; switch ($abSettings->compression) { From 005273e5a7843ca4f0c715883b09467c4585a99d Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Fri, 16 Aug 2024 06:56:54 +0200 Subject: [PATCH 2/6] Show `lsof` when failing to create tar archive as well --- src/include/ABHelper.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/include/ABHelper.php b/src/include/ABHelper.php index bb514d1..8e4f220 100644 --- a/src/include/ABHelper.php +++ b/src/include/ABHelper.php @@ -425,6 +425,16 @@ public static function backupContainer($container, $destination) { 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'; } From c6845144d32d87183667350920c7412e39c1e0d1 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Fri, 16 Aug 2024 07:20:36 +0200 Subject: [PATCH 3/6] adapt build. need more improvements though xD --- src/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/build.sh b/src/build.sh index 1fa7eb7..24d2d26 100644 --- a/src/build.sh +++ b/src/build.sh @@ -1,14 +1,15 @@ #!/bin/bash SUFFIX="" VERSION=$(date +"%Y.%m.%d") -if [ ! -z $1 ] + +if [ "$1" == "beta" ] then - VERSION=$VERSION$1 + SUFFIX=".beta" fi if [ ! -z $2 ] then - SUFFIX=".beta" + VERSION=$VERSION$1 fi From 0126b505a4d08400b51c4d3848627849640b3fa6 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Fri, 16 Aug 2024 07:22:19 +0200 Subject: [PATCH 4/6] Revert "adapt build. need more improvements though xD" This reverts commit c6845144d32d87183667350920c7412e39c1e0d1. --- src/build.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/build.sh b/src/build.sh index 24d2d26..1fa7eb7 100644 --- a/src/build.sh +++ b/src/build.sh @@ -1,15 +1,14 @@ #!/bin/bash SUFFIX="" VERSION=$(date +"%Y.%m.%d") - -if [ "$1" == "beta" ] +if [ ! -z $1 ] then - SUFFIX=".beta" + VERSION=$VERSION$1 fi if [ ! -z $2 ] then - VERSION=$VERSION$1 + SUFFIX=".beta" fi From fbf9f4de9eda31c68338b2a5cea5d77e512c7da1 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Fri, 6 Sep 2024 16:49:29 +0200 Subject: [PATCH 5/6] Add a slight visible line between container settings and the `Skip?` dropdown. Fixes #33 --- src/pages/content/settings.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/content/settings.php b/src/pages/content/settings.php index 4331b86..97ef13c 100644 --- a/src/pages/content/settings.php +++ b/src/pages/content/settings.php @@ -605,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
+