Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Apr 25, 2024
1 parent eef776d commit 8863be2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/app/Models/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ public function startBackup()

file_put_contents($backupTempScript, $shellFileContent);

$pid = shell_exec('bash '.$backupTempScript.' >> ' . $backupLogFilePath . ' & echo $!');
$pid = intval($pid);
$processId = shell_exec('bash '.$backupTempScript.' >> ' . $backupLogFilePath . ' & echo $!');
$processId = intval($processId);

if ($pid > 0 && is_numeric($pid)) {
if ($processId > 0 && is_numeric($processId)) {

$this->path = $backupPath;
$this->filepath = $backupFilePath;
$this->status = 'processing';
$this->queued = true;
$this->queued_at = now();
$this->process_id = $pid;
$this->process_id = $processId;
$this->save();

return [
Expand Down
15 changes: 15 additions & 0 deletions web/tests/Unit/BackupTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace tests\Unit;

use Faker\Factory;
use Tests\Feature\Api\ActionTestCase;

class BackupTest extends ActionTestCase
{
public function testBackup()
{


}
}

0 comments on commit 8863be2

Please sign in to comment.