0

I have setup the follow Laravel Cronjob command:

protected function schedule(Schedule $schedule)
{
    $schedule->command('DataDownloader:downloaddata')->dailyAt('19:34');
}

This saves some data from an API into a mySQL database. The command is listed under php artisan and I am able to run it using php artisan DataDownloader:downloaddata.

I have added the Cron entry to my crontab as per Laravel documentation:

* * * * * php /var/www/html/myprojectname/artisan schedule:run >> /dev/null 2>&1

When I run php artisan schedule:run it tells me 'No scheduled commands are ready to run'. I don't really know if this suggests if my Cronjob does not work at all or it is just broken.

Am I missing something or did I do something wrong that prevents the Cron from running?

My server is running Ubuntu with NGINX.

D. 777KLM
  • 450
  • 1
  • 9
  • 27
  • What user did "add the cron entry" to crontab? You may want to see https://stackoverflow.com/a/8476992/1564365 – Kyslik Aug 27 '17 at 18:58
  • @Kyslik I first tried a user that I added using `usermod -aG` and then the root account. – D. 777KLM Aug 27 '17 at 19:14

1 Answers1

1

schedule:run command fires other commands that are ready to run at the time of its execution. So it means that in that exact time you ran it, no command was to be started.

However, you have defined cron that runs schedule:run every minute, thus when 19:34 comes, your command will be executed.

crazko
  • 831
  • 8
  • 18