PHP exec() nohup with redirect -


i trying execute command exec() , redirecting stdout , stderr file.

exec("nohup python main.py -i 1 > /var/scripts/logs/1_out.log 2>&1 &");

it create file not print it.

if run command in terminal outputs without problem.

got working. python own output buffering kept writing file. running -u option disables this. final code looks this:

exec("nohup python -u main.py -i 1 > /var/scripts/logs/1_out.log 2>&1 </dev/null &");

thanks.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -