laravel vapor schedule job not running as scheduled - laravel

I have setup a laravel vapor as per documentation. Everything is working fine except scheduler.
I have set few artisan commands at certain intervals. But commands are not running as per schedule. If i run command manually it works. Seems like artisan schedule:run is not running and hence commands are not fired on defined time.
I checked lamda cli logs, no errors found. What do i check?

I fixed the issue adding below line in vapor.yml
scheduler: true

This was happening to me but in my case it was solved by composer dump-autoload.

Related

Laravel Cron Job not running over ubuntu server

I have a laravel application setup over Ubuntu server using Nginx. Here I have the cron jobs. I was facing an issue, that the server was not automatically picking up changes on Jobs Files. So I googled the things, and found a command from this article which I ran;
php artisan queue:restart
Since I have run this command, now no job is running even. I am also trying with simple HeartbeatJob to log info but it is also not working. When I do php artisan schedule:run,
no error in particular just screen output as:
[2021-09-11T08:41:32+00:00] Running scheduled command: App\Jobs\Heartbeat
But nothing happens. Any idea what this queue command has done wrong and how I make my jobs working again?
Your cron job will need the absolute path to artisan, so should look something like :
php /home/user/site.com/artisan queue:restart
You may also need to specify the queue with :
php /home/user/site.com/artisan queue:restart --queue=nameofqueue

Laravel job work command not working as before

My application's job - queue was working smoothly. Supervisor was also works fine before. But in last couple of day this jobs are not processing as before..
No error and nothing on logs file [Edited]
Queue driver set on Database
QUEUE_DRIVER=database
also tried QUEUE_DRIVER=sync
So, I've tried manual work command in vps. Although same code's working on local machine and my test-server And as you can see.. Nothing appears
also tried other commands
php artisan queue:work --queue=default --tries=1

Why do logs that are run by schedule:run on Laravel Vapor not saving in Cloudwatch?

So I have this in my Kernel.php $schedule->command('command:name')->hourly()->withoutOverlapping(); but it never stores the logs in Cloudwatch. However, if I run it manually using vapor command staging --command="php artisan command:name", they do get stored in Cloudwatch.
I am assuming it has to do with cron based commands in Laravel Vapor storing their output to /dev/null but I might be wrong. My goal is to capture these logs, any help? To add further, my command basically fetches data from an API for 50 records.
This is from the official Laravel Vapor documentation:
Log Messages
Due to Vapor limitations, log messages from scheduled tasks will not
appear in AWS CloudWatch or Vapor UI. As a workaround, you should
dispatch a queued job from your scheduled tasks and write log messages
from your queued job.
When you execute vapor command staging --command="php artisan command:name you are using the CLI. This mode generates logs and that's the reason you can see them.
Solved this by doing a symbolic link between the screen output and a log file. All thanks to #koalaok. See his answere here https://stackoverflow.com/a/46767123/4296706
ln -sf /proc/1/fd/1 /var/log/laravel-scheduler.log
and in my Kernel.php
$filePath = '/var/log/laravel-scheduler.log';;
$schedule->command('my sample command')->daily()->appendOutputTo($filePath);

Laravel cron not shooting on the given time

Hello Laravel cronjob is not shooting with the time give in following code
$schedule->command('snippets:newsletter')
->dailyAt('16:00')->runInBackground();
But when I am running this command it's going perfect
$schedule->command('snippets:newsletter')
->everyMinute()->runInBackground();
I think changing app time zone UTC in .env may resolve the issue
APP_TIMEZONE=UTC
then
PHP artisan config:clear
Ensure you have added an entry into your local system's crontab and that it is working correctly as described at https://laravel.com/docs/master/scheduling#introduction .

Cronjob setup for laravel 4.2 in cpanel

I am using laravel 4.2. I have created command file for cron job and added it into artisan file. I tested it in command. Everything is working fine in localhost. In Cpanel server I gave command path like,
php /home/fridayburr/public_html/version1/artisan active:user 1>> /dev/null 2>&1
But cron job is not working.
This is how I did in my shared Hosting using CPANEL
Here CRON Task is set on UNIX, to run every minute.
Add the schedule call with appropriate time schedule.
laravel Schedule documentation

Resources