From d9569df1ccbd37d94309ed01c93fd8ec136ab2c9 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 8 Aug 2023 14:53:08 +0300 Subject: [PATCH] pushd popd --- src/Appwrite/Platform/Tasks/Backup.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Backup.php b/src/Appwrite/Platform/Tasks/Backup.php index 5f5265c88d..0914fccd39 100644 --- a/src/Appwrite/Platform/Tasks/Backup.php +++ b/src/Appwrite/Platform/Tasks/Backup.php @@ -152,14 +152,18 @@ class Backup extends Action Console::exit(); } - unlink($logfile); + if (!unlink($logfile)) { + Console::error('Error deleting: ' . $logfile); + Console::exit(); + } } public function tar(string $directory, string $file) { $stdout = ''; $stderr = ''; - $cmd = 'cd ' . $directory . ' && tar zcf ' . $file . ' .'; + + $cmd = 'cd ' . $directory . ' && tar zcf ' . $file . ' . && cd ' . getcwd(); self::log($cmd); Console::execute($cmd, '', $stdout, $stderr); self::log($stdout); @@ -208,7 +212,10 @@ class Backup extends Action Console::exit(); } - unlink($file); + if (!unlink($file)) { + Console::error('Error deleting: ' . $file); + Console::exit(); + } } public static function log(string $message): void