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
On cron job, paths are not known. So, prefix
curl
with its path.If curl is in
/usr/bin/
, you shoul write: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 toindex.php
.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 istest_notification
.Know that when using the CLI you cannot use the session class. If you attempt to use sessions the CLI request will fail.