From 890a9d4e1fc8a556007ccb0ea13b514674af1b18 Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 27 Feb 2023 13:22:53 +0200 Subject: [PATCH] folder backup --- src/Appwrite/Platform/Tasks/Restore.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Restore.php b/src/Appwrite/Platform/Tasks/Restore.php index 73c8a36839..e0a3756396 100644 --- a/src/Appwrite/Platform/Tasks/Restore.php +++ b/src/Appwrite/Platform/Tasks/Restore.php @@ -48,7 +48,15 @@ class Restore extends Action $source = '/' . $folder . '/' . $filename; try { - $remote->transfer($source, $destination, $local); + $result = $remote->transfer($source, $destination, $local); + + if (!$result) { + Console::error("Error while trying to download back file"); + } + + if (!$local->exists($destination)) { + Console::error("Backup file not found for folder :$folder ,date $date"); + } $stdout = ''; $stderr = ''; @@ -59,7 +67,7 @@ class Restore extends Action $stderr ); - console::info("restoring from {$remote->getName()} $source to $destination"); + console::info("Restoring from {$remote->getName()} $source to $destination"); } catch (\Exception $e) { Console::error($e->getMessage()); }