I have a php script I am running on the command line. It takes ~10 hours or so to complete, so I have it running on a screen
so I can detach it, and check its progress throughout its run. I want to also log its output to a file. One solution is to run the script from a screen
with
[chiliNUT@server ~]# php myscript.php > log.txt
and then view the live output with
[chiliNUT@server ~]# tail -f ./log.txt
But the only problem is, at points the script requires input from the user via STDIN, so I'm stumped at that part. Typically, the screen
ed script just waits nicely for me to check in and provide input when needed.
How would I be able to
Log the script to a file
And be able to view live output as it is running
And provide input to STDIN when it requires it?
I do not want to modify the original script in any way.
Using php 5.4 and Centos 6.4 Final