skip to Main Content

This is my cronjob command. I am using codeigniter.

curl -s https://duainternational.com.pk/update_system/employee/test_notification >/dev/null 2>&1
cron time

M   H   D   M   Weekday
5   *   *   *   *

What am I doing wrong? I cannot get the cronjob running

2

Answers


  1. On cron job, paths are not known. So, prefix curl with its path.

    If curl is in /usr/bin/, you shoul write:

    /usr/bin/curl -s https://example.com/ >/dev/null 2>&1`
    
    Login or Signup to reply.
  2. Assuming you want to run a controller/method/argument on CodeIgniter then try using command line interface (CLI). (Documentation)

    You need to supply the full system path to CodeIgniter’s index.php file. I’m making assumptions about that path. Substitute your systems path to index.php.

    php /var/www/website/public_html/index.php update_system/employee test_notification
    

    Other assumptions I’m making are that the employee controller is on this path /application/controllers/update_system/ and the method you want to run is test_notification.

    Know that when using the CLI you cannot use the session class. If you attempt to use sessions the CLI request will fail.

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