1

I'm running apache2, and I've connected scripts with the html, I want to register all the echo outputs in a file named user.log. I've tried LOG_LOCATION="path" and it didn't works

> #!/bin/bash
opcion=$(php -r "echo urldecode('$QUERY_STRING');" | sed -n 's/^.*cmd=\([^&]*\).*$/\1/p')
NombreProceso=$(php -r "echo urldecode('$QUERY_STRING');" | sed -n 's/^.*name=\([^&]*\).*$/\1/p')

Fecha=$(date)

echo "-Procesos-" >> user.log

if [ $opcion == "1" ];then

sudo kill $NombreProceso -s SIGHUP
echo "$Fecha::Paramos el proceso $NombreProceso" >> **user.log**
fi 

if [ $opcion == "2" ];then
sudo kill $NombreProceso -s SIGSTOP 
echo "$Fecha::Pausamos el proceso $NombreProceso" >> **user.log**
fi

echo Content-Type: text/html
echo -e "

<html>
    <head>
        <title> UOLS WEB Unai Ayoub Jaime</title>

    </head>
    <body>"

echo -e "<textarea style='width:100%;height:90%; resize: none' disabled>"

        ps -e

        echo -e "</textarea>"
echo -e "
    </body>
</html>
"

1 Answer 1

1

You already did that in

echo "-Procesos-" >> user.log

Add ">> user.log" to all other echos commands

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.