mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
25 lines
507 B
PHP
Executable File
25 lines
507 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Actions\CronJob;
|
|
|
|
use App\Models\CronJob;
|
|
use App\Models\Server;
|
|
use App\SSHCommands\CronJob\UpdateCronJobsCommand;
|
|
use Throwable;
|
|
|
|
class DeleteCronJob
|
|
{
|
|
/**
|
|
* @throws Throwable
|
|
*/
|
|
public function delete(Server $server, CronJob $cronJob): void
|
|
{
|
|
$user = $cronJob->user;
|
|
$cronJob->delete();
|
|
$server->ssh()->exec(
|
|
new UpdateCronJobsCommand($user, CronJob::crontab($server, $user)),
|
|
'update-crontab'
|
|
);
|
|
}
|
|
}
|