Siraj Ali
Siraj Ali

Reputation: 604

How to stop specific schedule task (cron job) in laravel 5 on live server cpanel

I have created multiple schedule tasks in laravel 5, and created cron job on cpanel it is working fine. But now i want to stop specific schedule task, i have comment the command and remove class from app/Console/kernel.php file, but still it is running on live server on that specific time.

Befor in kernel.php

protected $commands = [
    Commands\CreatePostingSchedules::class,
    Commands\ChangeCreatedPostDuration::class,
    Commands\abc::class,
    Commands\xyz::class,
    Commands\NewMonthUser::class,
    Commands\DeliverOrdersWithCourier::class,
];

Now Remove the class Commands\ChangeCreatedPostDuration::class

After Removed the class:

protected $commands = [
Commands\CreatePostingSchedules::class,
Commands\abc::class,
Commands\xyz::class,
Commands\NewMonthUser::class,
Commands\DeliverOrdersWithCourier::class,
];

But still it is running on live server.

Please anyone can help ? how to stop this specific schedule task ?

Thanks

Upvotes: 0

Views: 3749

Answers (1)

user18203664
user18203664

Reputation:

Make sure that you have completely removed the scheduled function/command from "Kernel.php" of your Laravel 5 and that you do not have related manual CronJob in your cPanel -> CronJobs. You might also want to check this article: https://laracasts.com/discuss/channels/laravel/how-to-stop-scheduled-tasks-from-running-in-kernelphp

Upvotes: 1

Related Questions