I created a small bash script that takes a file using wget and then processes it using a php. The code goes like this:
wget -U mozilla -P /home/logfetcher/ http://fakesite.com/log.`date -d 'yesterday' +%Y-%m-%d`.csv wait /usr/bin/php csv-editor.php /home/logfetcher/log.`date -d 'yesterday' +%Y-%m-%d`.csv /home/logfetcher/sorted/log.`date -d 'yesterday' +%Y-%m-%d`.csv 3 9 7 0 2 1 5 11 12 13 && rm /home/logfetcher/*.csv
I tested it and it works without any problems, though when I added it to cron like this:
0 6 * * * /home/logfetcher/fetchlogs.sh
It downloads the file but the php seems to don't work at all (nor the rm, which I guess indicates an error trying to run the php file). I've been trying to think about why this could be failing and tried a few things, but I don't seem to find a proper answer to fix it. Any help would be appreciated!