Category : cron

I have a schedule task which runs every 5 minutes. This schedule command puts some data to Redis cache via controller. Kernel.php … protected $commands = [ CommandsDataCommand::class, ]; protected function schedule(Schedule $schedule) { $schedule->command(‘data:cache’)->everyFiveMinutes()->onOneServer()->runInBackground(); } DataCommand.php … public function handle() { app(‘AppHttpControllersDataProcessing’)->setCache(); } DataProcessing.php … public function setCache() { $data = [‘one’, ‘two’, ‘three’]; ..

Read more

Ι have setup 2 laravel cronjobs that both run run queries to the database: $schedule->command(MyCommand::class,[‘param’, ‘1’])->daily(‘1:30’); $schedule->command(MyCommand::class,[‘param’, ‘2’])->daily(‘1:30’); And the command is the following: use IlluminateConsoleCommand; class MyCommand extends Command { $signature = "my:command –param {param}" public function run() { $sql = DB::select(^some_heavy_query^); // Do other stuff } } Both crons run in a single ..

Read more

I set up a abc.sh file on the desktop and in that I added php /home/myUserName/DEVS/LaravelApp/artisan schedule:run 1>> /dev/null 2>&1 by using crontab -e command, I added * * * * * /bin/sh /home/myUserName/Desktop/abc.sh and I run the crontab from Desktop using chmod u+x abc.sh in my laravel project kernel.php protected function schedule(Schedule $schedule) { ..

Read more

I need to perform a scheduled task in CPanel, I know I should use CRON to do the task every day. I’m using Laravel 7 and PHP version 7.2, I try running task locally on windows and make sure it works, but when I try running using CRON didn’t works I also check that I ..

Read more

I do have a docker file runing a laravel app and some runners. The schedule is triggering the command but it is not doing anything. Whenever I try to run the command manually it works fine. The command consulta_a1 dispatch a job that is suposed to fail, doing so the supervisor will log it on ..

Read more

I’ve built a Laravel system that schedules an artisan command to run daily at a specific time based off of a variable which is set in the .env file. This is because we need to set differing times for each installation of this syten. .env DEBTOR_EMAIL_TIME="12:30" Kernel.php protected function schedule(Schedule $schedule) { $schedule->command(‘commandt:make –[email protected]’)->dailyAt(env(‘DEBTOR_EMAIL_TIME’)); } ..

Read more

I have scheduled task which working is fine. every 2 hours , from 7:59, to 18:01. $schedule->call(‘[email protected]’)->everyTwoHours()->between(‘7:59′, ’18:01’); However , I only want it to run from Monday to Friday so I added weekdays() $schedule->call(‘[email protected]’)->weekdays()->everyTwoHours()->between(‘7:59′, ’18:01’); But unfortunately if will start from 00:00 every weekdays. This is not what I want. I want it to ..

Read more

In laravel 7, I setup cronjobs that runs base from different users specific timezone. Here’s the exact code: foreach (User::role(‘admin’)->get() as $user) { /* with queue job */ $schedule->command(‘weekly-survey:send’)->timezone($user->timezone)->weekly()->wednesdays()->at(‘8:00’); $schedule->command(‘update:surveys-completed’)->timezone($user->timezone)->daily(); $schedule->command(‘trial:reminder’)->timezone($user->timezone)->dailyAt(‘7:45’); $schedule->command(‘trial:ends’)->timezone($user->timezone)->dailyAt(’23:00′); $schedule->command(‘subscribe:customer’)->timezone($user->timezone)->dailyAt(’23:45′); $schedule->command(‘update:user-invoice’)->timezone($user->timezone)->everyMinute(); $schedule->command(’employees:update-status’)->timezone($user->timezone)->everyMinute(); $schedule->command(‘subscription:update-quantity’)->timezone($user->timezone)->daily(); $schedule->command(‘update:freeze-account’)->timezone($user->timezone)->dailyAt(’22:45′); $schedule->command(‘send:upcoming-survey-notification’)->timezone($user->timezone)->weeklyOn(1, ‘8:00’); $schedule->command(‘surveys:end-soon’)->timezone($user->timezone)->dailyAt(‘8:00’); /* end with queue job */ /* without queue */ $schedule->command(‘amazon:get-send-qouta’)->timezone($user->timezone)->dailyAt(’23:55′); $schedule->command(‘amazon:get-statistics’)->timezone($user->timezone)->dailyAt(’23:55′); $schedule->command(‘update:customer-success-table’)->timezone($user->timezone)->everyMinute(); $schedule->command(‘csm:prev-month-active’)->timezone($user->timezone)->lastDayOfMonth(’23:59′); $schedule->command(‘update:monthly-earning’)->timezone($user->timezone)->lastDayOfMonth(’23:59′); ..

Read more

Need to update PHP, MongoDB Library or Certificate update on AWS Linux based instance in order to run the cron job Here is the error from Old MongoDB Connection String from PHP Laravel "No suitable servers found (serverSelectionTryOnce set): [TLS handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed calling ismaster" Here is the error from new MongoDB ..

Read more

I tried this for days and seeking answers but it still not working * * * * * usr/bin/php /home/dss/laravelAppDss/artisan schedule:run >> /dev/null 2>&1 Here is my Kernel.php <?php namespace AppConsole; use IlluminateConsoleSchedulingSchedule; use IlluminateFoundationConsoleKernel as ConsoleKernel; class Kernel extends ConsoleKernel { protected $commands = [ ‘AppConsoleCommandsSinkronDSS’, ]; protected function schedule(Schedule $schedule) { $schedule->command(‘sinkron:dss’)->daily()->timezone(‘Asia/Singapore’); } ..

Read more

I don’t want to set server cron to run every minute (* * * * *) so I set it to @daily @daily usr/bin/php /home/dss/laravelAppDss/artisan schedule:run >> /home/dss/public_html/example.txt This is my Kernel.php <?php namespace AppConsole; use IlluminateConsoleSchedulingSchedule; use IlluminateFoundationConsoleKernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. ..

Read more