Tuesday, 27 August 2013

crontab run cURL in Centos not working

crontab run cURL in Centos not working

I would like to run a cronjob with curl in centos 6.4 64bits. I am writing
the code with CodeIgniter.
$crontab -e
inside crontab, I try to output it to a file to make sure this cronjob is
working or not.
*/5 * * * * /usr/bin/curl --silent --compressed
http://localhost/ci/ftp/index/ > /var/www/html/1.log >/dev/null 2>&1
So true that, the file is created on the location, I can sure the cronjob
is running. However I don't get any output in the file. It is an empty.
The script I am running is a PHP FTP module, to grab a file from a ftp
every 5 minutes.
If I run the script manually, I have the correct output, but nothing from
the cron job. I did specific the full path of the curl by using which curl
This is the command I run it manually:
/usr/bin/curl --silent --compressed http://localhost/ci/ftp/index/
Any idea how can I troubleshoot this?

No comments:

Post a Comment