Code: Select all
#!/usr/bin/env bash
cd "$(dirname "$0")"
PHP=`which php`
# echo $PHP php -v
$PHP /home/me/highcharts_combined_array.php # generates the highcharts formated json file
sleep 2
highcharts-export-server -logLevel 4 -infile high_combined.json -outfile /www/x/public_html/php/x/images/combined_chart.png
The problem is if I run it as a cron job I get the following error:
Code: Select all
/home/me/highcharts_x_combined.sh: 10: /home/me/highcharts_x_combined.sh: highcharts-export-server: not found
Code: Select all
cd /home/me/ && /home/me/highcharts_x_combined.sh
Code: Select all
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
node -v
v8.10.0
export server v2.1.0
Code: Select all
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] attaching exit listeners to the process..
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] Pool started:
maxWorkers: 1
initialWorkers: 1
workLimit: 60
listening to process exit: true
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] phantom 1 - spawning worker
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] starting export
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] attempting to export from input file
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] phantom - received work, finding available worker
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] phantom - found available worker
Thu Aug 04 2022 17:30:40 GMT-0600 (MDT) [verbose] phantom 1 - starting work
Thu Aug 04 2022 17:30:41 GMT-0600 (MDT) [notice] phantom worker 1 finished work ??? in 556 ms
Thu Aug 04 2022 17:30:41 GMT-0600 (MDT) [notice] phantom worker 1 - process was closed
Thu Aug 04 2022 17:30:41 GMT-0600 (MDT) [notice] terminating, killing all running phantom processes