My below code works fine to execute a bash script in the background from PHP:
$cmd = "(touch $run_file && java -jar $trimmomatic SE -threads 8 $file $trimmed_file HEADCROP:5 && rm $run_file)";
exec($cmd . " > /dev/null &");
What I want to add is to execute an external php file upon the completion of this command.
I tried this it but didn't work:
$cmd = "(touch $run_file && java -jar $trimmomatic SE -threads 8 $file $trimmed_file HEADCROP:5 && rm $run_file && php -f confirm.php)";
exec($cmd . " > /dev/null &");
How can I make sure to execute confirm.php
upon completion of the bash script?