Using a system command with an ampersand at the end does not start the process in the background

I am making a simple call to restore a mysql backup, which takes about 45 minutes to complete on one of my servers.

system("mysql -u$user -p$pass $db < '$file' &"); 

Running this method blocks my browser, and I have to wait until it is finished before I can do anything. This works fine on my other server. What settings can interfere with the work on the first server?

+4
source share
1 answer

You still have a descriptor for output channels (stdout & stderr) that completely prevents background rendering.

add > /dev/null 2>&1 to the end.

+8
source

All Articles