skip to Main Content

I have a code in laravel, I want to setup a cron job in cpanel But I don’t know how to. I saw several examples that has file name to cron, but I am using Laravel so how can I point this to URL route?

/usr/bin/curl https://example.com/cron_route

I am not sure is this correct method or I can do that in different way, well I canot use laravel artisan scheduler, I have all custom code and custom Controller.

can anyone help me out with this?

2

Answers


  1. Try this command

       1 1 * * 0  /usr/bin/curl -m 120 -s https://example.com/cron_route &>/dev/null
    
    Login or Signup to reply.
  2. To add cronjob using command line, use this command

    0 2 * * * wget -q -O /dev/null http://example.com/cron_script
    

    See for reference : https://crontab.guru/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search