Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 2 years ago.
0

I have been trying to set up scheduler as per your instructions with no result.

When I try:

  1. /usr/local/bin/php /home/mysite/public_html/protected/app/start/artisan cron:run it gives error Could not open input file: /home/mysite/public_html/protected/app/start/artisan

  2. /usr/local/bin/php /home/mysite/public_html/protected/app/controllers/TestController.php it gives error Fatal error: Class 'BaseController' not found in

  3. /usr/local/bin/php -q /home/mysite/public_html/protected/app/start/artisan cron:run Error-Could not open input file:

  4. php /var/www/com/mysite.com/artisan cron:run Status: 404 Not Found No input file specified.

  5. /usr/local/bin/php home/opendesk/public_html/protected/app/start/artisan.php and in artisan.php I do like Artisan::add(new CronRunCommand); Error Fatal error: Class 'Artisan' not found

  6. /usr/local/bin/php /home/opendesk/public_html/protected/app/start/artisan.php when in artisan.php I change it to $artisan->add(new CronRunCommand); Error Fatal error: Call to a member function add() on a non-object None of it seems to work. Can you please help

0

Just in case anyone has the same issue as me.

  1. When I manually ran "php artisan cron:run" I didn't get any message to the screen... however it was working, it just writes message to the log file.... app/storage/logs/laravel.log had the entry.

  2. It isn't specified here but you need to run the command from the root of the laravel installation you are working in.

  3. To get the cron working I had to use this for the command (cd to the root of the laravel installation then call artisan, using the full path to php)

*/5 * * * * cd /usr/home/laravelroot/ && /usr/local/bin/php artisan cron:run

That being said I got it working and I am super thankful, this was WAYYYY easier than doing the upgrade to 5.1 for this app.

Much love to sisou for sharing this

Last updated 9 years ago.
0

I wrote a new timed function... it runs every 5 minutes between an hour range you pass in.

Add this to the list of functions

protected function everyFiveMinutesFrom($start_hour, $end_hour, callable $callback)
{
if( ((int) date('H', $this->timestamp) >= $start_hour) && ((int) date('H', $this->timestamp) <= $end_hour) && ((int) date('i', $this->timestamp) % 5 === 0) ) call_user_func($callback);
}

and call it like this

$this->everyFiveMinutesFrom('07', '18', function() {
//code
});
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

sisou sisou Joined 11 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.