From fc4a4aafb44e44e613b6a02255d9f96bb0b3606b Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Thu, 6 Mar 2025 00:12:58 +0000 Subject: [PATCH] bug fix --- hesabixCore/src/Command/UpdateSoftwareCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hesabixCore/src/Command/UpdateSoftwareCommand.php b/hesabixCore/src/Command/UpdateSoftwareCommand.php index 02a26a7..237d480 100644 --- a/hesabixCore/src/Command/UpdateSoftwareCommand.php +++ b/hesabixCore/src/Command/UpdateSoftwareCommand.php @@ -395,4 +395,14 @@ class UpdateSoftwareCommand extends Command $state['log'] .= $output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL ? $message . "\n" : ''; file_put_contents($this->stateFile, json_encode($state)); } + + private function backupArchive(): string + { + $tarFile = $this->backupDir . '/hesabixArchive_backup_' . time() . '.tar'; + $this->runProcess(['tar', '-cf', $tarFile, '-C', $this->rootDir, 'hesabixArchive'], $this->rootDir, new \Symfony\Component\Console\Output\NullOutput()); + if (!file_exists($tarFile)) { + throw new \RuntimeException('Failed to create tar backup of hesabixArchive.'); + } + return $tarFile; + } } \ No newline at end of file