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 - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -