Hi David hope all is well,
My host is not longer letting me use wget, so for fetch.php which I'm calling via a cron job I'm getting a permission error.
They have said I can use Curl, I've tried multiple cron command line jobs but no success as yet.
My latest is:
cd /home/mydomain.co.uk/custom-includes/; /usr/local/bin/php -f fetch.php @ALL
The email report I get back just contains the contents of fetch.php, it doesn't seem to 'activate' the script.
The opening lines of fetch.php are as follows:
#!/bin/sh
#########
# FETCH #
#########
curl "/home/mydomain.co.uk/feeds/awin_merchant.xml.gz" "http://datafeed.api.productserve.com/datafeed/download/apikey/...etc"
Any ideas on what I can do here?
Many Thanks,
Stew
Hi David, thanks for that. I changed fetch.php to fetch.sh and also the cron job as described.
This time I don't get an email report, but the feed becomes registered in the admin area - but there is no data in the feed, the feed file size is zero.
Not sure what to try next, have checked the feed url is correct and all seems OK?
Many Thanks
Stew
Hi Stew,
It's possible that the path to CURL is required; in your fetch.sh try replacing
curl
with
/usr/bin/curl
I also think the -o option (output file) is required in front of your save as parameter - all together have a go with:
/usr/bin/curl -o "/home/mydomain.co.uk/feeds/awin_merchant.xml.gz" "http://datafeed.api.productserve.com/datafeed/download/apikey/...etc"
Cheers,
David.
--
PriceTapestry.com
Hi David - that worked great :-)
Thanks for your help there!
Hi Stew,
That looks like your fetch script is actually shell commands rather than PHP - so ideally it should be called fetch.sh rather than fetch.php. If you make that change of name, and then as your CRON job just use:
cd /home/mydomain.co.uk/custom-includes/;/bin/sh fetch.sh
Hope this helps!
Cheers,
David.
--
PriceTapestry.com