I have a php script that triggers a remote bash script which in turn triggers let another remote bash script (all machines are talking to each other with ssh key pairs and working fine)...
PHP (server 1) --> BASH (server 2) --> BASH (server 3)
There is a whole bunch of functions in the first bash script which all work perfectly, variables are passed right the way through the process, and then at the end there is a command to run a further script on server 3 :
ssh email@example.com "/var/www/getpodcast.sh $1";
wget -o /var/www/vhosts/site1/httpdocs/audio/$1 http://xxx.xx.xx.xx.xxx/complete/$1
Per comments, you identified that the output from your
wget command contained the text that wget produces, rather than the content of the file in the URL you specified.
According to the wget man page:
-o logfile --output-file=logfile Log all messages to logfile. The messages are normally reported to standard error.
This isn't what you're looking for, so yes, this is a wget usage error.
Instead, you probably either want to use
curl, which uses a
-o option the way you'd expect, or switch to wget's
-O (capital O) option. Note that wget by default will name the files it saves the same as in the URL; read the man page to see how
-O's behaviour is different from this.