Skip to content

Commit b159d67

Browse files
committed
Fixed exclusion
1 parent 7dfa708 commit b159d67

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/include/ABHelper.php

+4
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ public static function backupContainer($container, $destination) {
292292
foreach ($excludes as $exclude) {
293293
$exclude = rtrim($exclude, "/");
294294
if (!empty($exclude)) {
295+
if (str_starts_with($exclude, $dockerAppdataPath)) {
296+
self::backupLog("exclude is within appdata apth: stripping appdata path", self::LOGLEVEL_DEBUG);
297+
$exclude = ltrim(str_replace($dockerAppdataPath, '', $exclude), '/');
298+
}
295299
array_unshift($tarOptions, '--exclude ' . escapeshellarg($exclude)); // Add excludes to the beginning - https://unix.stackexchange.com/a/33334
296300
array_unshift($tarVerifyOptions, '--exclude ' . escapeshellarg($exclude)); // Add excludes to the beginning - https://unix.stackexchange.com/a/33334
297301
}

src/scripts/backup.php

+1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
$backupDate = date_create_from_format("??_Ymd_His", $correctedItem);
364364
if (!$backupDate) {
365365
ABHelper::backupLog("Cannot create date from " . $correctedItem, ABHelper::LOGLEVEL_DEBUG);
366+
$toKeep[] = $backupItem; // Keep the errornous object - Better safe than sorry.
366367
continue;
367368
}
368369
if ($backupDate >= $nowDate && !in_array($backupItem, $toKeep)) {

0 commit comments

Comments
 (0)