From 76bd0bf8f24fca0d4c809342dea7581301996f17 Mon Sep 17 00:00:00 2001 From: Robin Kluth Date: Sun, 17 Mar 2024 16:42:40 +0100 Subject: [PATCH] move post-run to after chmod'ing the destination --- src/scripts/backup.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/backup.php b/src/scripts/backup.php index b2416f3..dce4c0a 100644 --- a/src/scripts/backup.php +++ b/src/scripts/backup.php @@ -372,8 +372,6 @@ ABHelper::notify("Appdata Backup", "Backup done [$backupDuration]!", "The backup was successful and took $backupDuration!"); } -ABHelper::handlePrePostScript($abSettings->postRunScript, 'post-run', $abDestination, (ABHelper::$errorOccured ? 'false' : 'true')); - if (!empty($abDestination)) { copy(ABSettings::$tempFolder . '/' . ABSettings::$logfile, $abDestination . '/backup.log'); copy(ABSettings::getConfigPath(), $abDestination . '/' . ABSettings::$settingsFile); @@ -390,6 +388,9 @@ exec("chmod u=rwx,g=rx,o=- " . escapeshellarg($abDestination)); } + +ABHelper::handlePrePostScript($abSettings->postRunScript, 'post-run', $abDestination, (ABHelper::$errorOccured ? 'false' : 'true')); + if (file_exists(ABSettings::$tempFolder . '/' . ABSettings::$stateFileAbort)) { unlink(ABSettings::$tempFolder . '/' . ABSettings::$stateFileAbort); }