From dbef2e284c1152d1c94cf203da8e5d7987aab700 Mon Sep 17 00:00:00 2001 From: Lewis Larsen Date: Tue, 25 Jun 2024 19:35:55 +0100 Subject: [PATCH] chore: added debugging to database backup process --- app/Services/Backup/Backup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/Backup/Backup.php b/app/Services/Backup/Backup.php index e6a4946b..44231a37 100644 --- a/app/Services/Backup/Backup.php +++ b/app/Services/Backup/Backup.php @@ -438,6 +438,8 @@ protected function dumpRemoteDatabase( throw new DatabaseDumpException('Unsupported database type.'); } + $this->logDebug('Database dump command.', ['command' => $dumpCommand]); + $output = $sftp->exec($dumpCommand); $this->logDebug('Database dump command output.', ['output' => $output]); @@ -454,6 +456,9 @@ protected function dumpRemoteDatabase( throw new DatabaseDumpException('Database dump file was not created or is empty.'); } + $fileContent = $sftp->exec('cat ' . escapeshellarg($remoteDumpPath)); + $this->logDebug('Database dump file content snippet.', ['content' => substr($fileContent, 0, 500)]); + $this->logInfo('Database dump completed successfully.', ['remote_dump_path' => $remoteDumpPath]); }