The scenario:
- I have a PHP script (accessed via the web) which generates a shell script which needs to continue to run even after the request ends.
- I need the output sent to a file on disk (i.e. "./script.sh > run.log")
Every approach I try seems to result in PHP still waiting for the shell script to finish executing. Approaches I've tried:
nohup ./script.sh > run.log &
nohup ./script.sh > run.log 2>&1
nohup ./script.sh > run.log 2>&1 &
./script.sh &
./script.sh > run.log 2>&1
./script.sh > run.log &
I think there's something really obvious I might be missing. Any ideas?