I have an email parsing script on a Codeigniter site that I want to trigger each day with a cronjob. I don't have much experience with cronjobs, or command line on remote servers.
I have a cronJobs controller at mysite.com/public_html/application/controllers/cronJobs. In it is a parseMail method. I'm also using mod_rewrite to get rid of index.php from URLS.
The parseMail method does work when I hit the controller "normally" through my browser at MYSITE.com/cronJobs/parseMail. There is a DB insert that goes off.
But to trigger it with cronjob I have tried >>>
wget http://MYSITE.com/cronJobs/parseMail
And I do get a notification email.. but I'm not sure how to interpret it. It's finding the script? There is no error? Regardless, the parseMail doesn't fire.
--2013-01-19 12:00:02-- http://MYSITE.com/cronJobs/parseMail
Resolving MYSITE.com... xx.xx.xx.xxx
Connecting to MYSITE.com|xx.xx.xx.xxx|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `parseMail.203'
0K 0.00 =0s
2013-01-19 12:00:03 (0.00 B/s) - `parseMail.203' saved [0/0]
I also tried
-q wget http://MYSITE.com/cronJobs/parseMail
And received "/bin/sh: get: command not found"
Then I have also tried variations on this..
/usr/local/bin/php -q /public_html/index.php cronJobs parseMail
/usr/local/bin/php -q /public_html/ cronJobs parseMail
/usr/local/bin/php -q home/myusername/public_html/index.php cronJobs parseMail
/usr/local/bin/php -q home/myusername/public_html/ cronJobs parseMail
With these methods I cant even seem to hit the controller. My email notification just says "Could not open input file".
I'm just not really familiar with any of these errors.. so I don't know how to hone in on a solution.
Can anyone give me any tips how to move forward?