I have a script with a curl command in it for php to execute:
#!/bin/bash echo "test" > file curl -d "credentials=foobar" -d "title=$server down" https://notifi.it/api
I can execute from the command line:
/usr/bin/php -r "echo shell_exec(\"/root/notify-down-script.sh test\");"
which works perfectly. When I add to the cron:
* * * * * /usr/bin/php -d safe_mode=Off -r "echo shell_exec(\"/root/notify-down-script.sh test\");"
This does not call the curl (does call the
echo). This is all ran as root. I have tried to catch the output (> /tmp/curl.log) of the curl in the script but nothing happens. I have tried to do the full path of the curl. I am completely lost. What am I doing wrong?