You should really avoid installing postgreSQL I'd suggest checking it is installed and reporting an issue if not.
The loop at the end of this script never ends as it uses a
while [ true ] loop
the loop creates three files :
who-<PID>@<HOST>.log file with output from who command
top-<PID>@<HOST>.log file with output from top command
ps-<PID>@<HOST>.log file with output from ps command
these are written into the current directory and appended every 10 seconds.