0

I have setup cronjob for root user in redhat server environment as follows by typing crontab -e for delete file in storage project

in my laravel project running if i run php artisan schedule:run, but not automatic run for every 5 minute,,, checked for var/log/cron i see cronjob automatic running

var/log/cron

shcedule:run

Diale
  • 116
  • 2
  • 8

2 Answers2

1

you only need to add the following Cron entry to your server

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

More info check laravel doc

Senthurkumaran
  • 1,738
  • 2
  • 19
  • 29
  • how if I use 2 cronjob in 1 Server Redhat? – Diale Jul 21 '20 at 15:36
  • you can use what ever number of cronjob. Just you need to schedule every cronjob in your `App\Console\Kernel` class and run above command in your server. More info check https://laravel.com/docs/7.x/scheduling#defining-schedules – Senthurkumaran Jul 22 '20 at 03:15
0

Solved

1. make sure your time (server site) e.g running every 30mnt

*/30 * * * * cd /path-to-your-project && php artisan schedule:run

2. make sure your time (laravel site) e.g running at 00:30

30 0 * * *

so if your project (laravel) running with 30mnt (e.g 30 0 * * ) so you must setup server with 30mnt (/30 * * * *)

Diale
  • 116
  • 2
  • 8