This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jerry3850
jerry3850

Using my cPanel, I manually set up a cron job to run every 30 minutes (my hosting company does not allow me to set my cron jobs to run in less than 30 minute increments) as follows:

0,30 * * * * /usr/local/bin/php -q /home/example/public_html/artisan scheduled:run 1>> /dev/null 2>&1

I also added the registerSchedule method to my Plugin registration file, Plugin.php as shown below:

use Example\MySearch\Components\GetProducts;
class Plugin extends PluginBase
{
    public function registerSchedule($schedule)
    {
        $schedule->call(function() {
            GetProducts::instance()->sendMail();
        })->everyFiveMinutes();
    }
}

But no matter what I do, nothing ever happens. When I run php artisan scheduled:summary on my server this is what I get:

+----------------+------+-----------+--------+------+--------------+-------+-------------+--------+
| Environment(s) | Name | Args/Opts | Minute | Hour | Day of Month | Month | Day of Week | Run as |
+----------------+------+-----------+--------+------+--------------+-------+-------------+--------+
+----------------+------+-----------+--------+------+--------------+-------+-------------+--------+

I have checked separately that the sendMail() method I wrote works, so that is not the problem. I have even tried manually running php artisan scheduled:run and that doesn't work. I am not getting any error messages either.

What am I missing or what am I doing wrong?

Last updated

jerry3850
jerry3850

Isn't there someone out there who can help me with this???

Last updated

gaberiv8076
gaberiv8076

I noticed you are using scheduled:run instead of schedule:run. Also, maybe try to run ->everyThirtyMinutes to match your hosting environment. Perhaps write to a log file within the registerSchedule($schedule) method to make sure it is actually being called.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.