0

I would like to execute some php script via cron job i have curl, crontab installed, but the cron job dosen't run/create any log file.

crontab -l

* * * * * curl  http://www.mydomain.com/index.php?r=myController/myFuncction >> /var/www/cronJobLogs/myCtrLog.txt 2>&1

I executed manually this line on terminal, and the log file was created

curl  http://www.mydomain.com/index.php?r=myController/myFuncction >> /var/www/cronJobLogs/myCtrLog.txt 2>&1

UPDATE

Theroetilaclly my crons should be run in every minute.

root@vs3946:/var/www/cronJobLogs# whereis curl

    curl: /usr/bin/curl /usr/share/man/man1/curl.1.gz
    root@vs3946:/var/www/cronJobLogs# crontab -l
    # m h  dom mon dow   command
    * * * * * /usr/bin/curl  http://www.mydomain.com/index.php?r=myController/myFuncction >> /var/www/cronJobLogs/myCtrLog.txt 2>&1
    */1 * * * * /usr/bin/curl  http://www.mydomain.com/index.php?r=myController/myFuncction >> /var/www/cronJobLogs/myCtrLog.txt 2>&1
1
  • what's in /var/log/cron.log?
    – faker
    Jun 18, 2014 at 13:11

1 Answer 1

1

Specify the full path to curl in your crontab - your shell knows where to find it because there's a $PATH environment variable available, but there's no such beast in the cron environment.

1
  • i set the path of curl but it dosen't resolve my problem the log not exist in cronJobLog folder.
    – Nagy Ervin
    Jun 18, 2014 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .