Server 1 : php script
Server 1 sets the $mp3file
variable which is received by the bash script on Server 2 as $1
The php script calls ssh2_exec like this (minus all the connection info) :
$stream = ssh2_exec($connection, "/root/incoming/test.sh ".escapeshellarg($mp3file)." &> /dev/null &");
Server 2 : bash script
test.sh (on server 2) contains a simple curl command :
curl -o /path/to/downloaded/file/$1 http://remotefilepath.com/$1
This all works perfectly, and the file is downloaded as expected.
But if I try to pass more than one variable like this :
$stream = ssh2_exec($connection, "/root/incoming/test.sh ".escapeshellarg($mp3file)." ".escapeshellarg($artwork)." &> /dev/null &");
The file is only partially downloaded.
Am I setting multiple variables the wrong way here which is breaking the &> /dev/null &
command?