mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
clean up
This commit is contained in:
@@ -30,9 +30,8 @@ class DbRestore extends Action
|
||||
*/
|
||||
public function action(string $file): void
|
||||
{
|
||||
// $file = '2023-07-12_09:37:47.tar.gz';
|
||||
|
||||
Console::log('Restoring backup' . $file);
|
||||
$start = microtime(true);
|
||||
Console::log('Started' . $file);
|
||||
|
||||
$file = DbBackup::$backups . '/' . $file;
|
||||
|
||||
@@ -51,24 +50,17 @@ class DbRestore extends Action
|
||||
|
||||
$stdout = '';
|
||||
$stderr = '';
|
||||
|
||||
// $start = microtime(true);
|
||||
// Console::log($start);
|
||||
|
||||
$cmd = 'tar -xzf ' . $file . ' -C ' . $this->extract;
|
||||
Console::log($cmd);
|
||||
$code = Console::execute($cmd, '', $stdout, $stderr);
|
||||
|
||||
// Console::log('time end ' . (microtime(true) - $start));
|
||||
|
||||
if (!empty($stderr)) {
|
||||
Console::error($stderr);
|
||||
Console::exit();
|
||||
}
|
||||
|
||||
Console::log($stdout);
|
||||
// // Todo: start down target container
|
||||
// Todo: start down target container
|
||||
|
||||
Console::log("Restore Finish");
|
||||
Console::log("Restore Finish in " . (microtime(true) - $start) . " seconds");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user