Hi guys, my first post time here, so hello to everyone
I've got a problem running one of my scripts at work. I can get crontab working on simple scripts (i.e. one that just outputs date to a temp file). but it won't correctly execute the script i want to use.
My script is a PHP script. It will log into different machines on the network, runs commands, then pipe the output to local files. This script works if executed manually, can't find any faults here. The script itself and the files it writes to have been set to +777 permissions.
The script calls a sub-script, which is an Expect script. I use this to SSH into the various machines on the network. It does not read/write to files. This script's permissions has been set to +777 as well. It runs correctly when manually executed.
Now when I set the crontab job to run, I know that it actually tries to call the script. This is because the call gets logged in the crontab logs (which is located in /var/log/cron). So it calls the script, but i'm not getting any output.
my crontab file looks something like this:
*/10 * * * * /usr/bin/php /absolute/path/to/script.php
0 * * * * /absolute/path/to/script.php
The first line is intended to call the script every 10 minutes. The second line is intended to call the script every hour. They're both the same script (i've just been experimenting with syntax which is why the calls to the script are different).
Any ideas? Thanks in advance for your help, guys!