I have a shell script that goes through every JSon file in a directory and uses phantomJS to create a highchart png.
The problem comes when scheduling a cron task to run this script - (Initially I used inotifywait but got the same error).
The shell script looks like this:
#!/bin/sh
for i in *.json; do
filename="${i%.*}"
phantomjs /var/www/highcharts.com/exporting-server/phantomjs/highcharts-convert.js -infile $i -outfile img/$filename.png -scale 2.5 -width 300 -constr Chart -callback /var/www/highcharts.com/exporting-server/phantomjs/callback.js
done
and the cron task looks like this:
* * * * * /var/www/highcharts.com/exporting-server/phantomjs/test/createGraphs.sh >> /var/www/highcharts.com/exporting-server/phantomjs/highcharts.log
In the log file I'm getting the error:
"Unable to open file '*.json'"
The shell script runs fine when run from the command line, but the problem comes when trying to schedule it.