1
Hello I have a PHP script that I run on a server, I put it in a cron. For security and maintenance reasons I write all the return of STDERR in a file, but even if the file does not return me anything it writes a line break " n" in the file how can I proceed? Below is the execution model I use to write the STDERR to the file.
*Obs would like it to store only if there was a different return of " n"
usradm01@prod-analytics:~$ php /home/usradm01/monitoringservers.php >> /tmp/monitoring_servers_error.log 2>&1
So I need to increment it, because if there are problems anoite or other time would have this information, but I would like it to be incremented only if there is some content.
– Hiago Souza
I was able to make use of php /home/usradm01/monitoringservers.php | sed "/ s*$/d" >> /tmp/err.log
– Hiago Souza
But I’m going to give you a positive answer because you put me on the right path of research ;)
– Hiago Souza
you can put your answer as right
– Adir Kuhn
How ?? I don’t know..
– Hiago Souza
creates an answer and puts the solution
– Adir Kuhn
Thanks again!!
– Hiago Souza