I have a shell script for getting data from some servers, in ~/.bin/shellScript
:
OLD="$(curl --silent http://someServer:12345/stats.json | json someKey)"
NEW="$(curl --silent http://otherServer:12345/stats.json | json someKey")
echo "OLD $OLD - NEW $NEW"
I want to echo the results for running it interactively, but I've been wanting to log the results collected too.
So crontab -e
, and add */5 * * * * /home/user/.bin/shellScript >> /media/dump/scriptDump
.
Running the script interactively works fine - I get OLD 123 - NEW 456
, but when I look at what's been running from cron, I get OLD - NEW
with no data being grabbed with curl.