From: Volkan YAZICI (volkany@phreaker.net)
Date: Mon 29 Sep 2003 - 06:37:44 EDT
On Mon, 29 Sep 2003 12:06:19 +0300
"Hıdır Atsız" <hidir@sanalnet.com> wrote:
> Merhaba arkadaşlar
> mysql de aktif kullanıcı varmı yokmu nasıl anlayabilirim
asagida ben postgresql icin ne yapabilirim diye baktim
ortaya amele olmakla birlikte bir cozum cikti:
$ ps aux
...
postgres 1369 0.5 1.2 8972 3232 ? S 13:28
0:00 postgres: knt yap
...
iste benim boa (best of amele) script'lerim arasinda
#!/bin/sh
for currLn in $(ps aux)
do
procInf=$(echo $currLn | '{print $11}')
if [ "$procInf" -eq "postgres:" ]
then
procOwner=$(echo $currLn | awk '{print $1}')
procUser=$(echo $currLn | awk '{print $12}')
echo -n "procOwner: '${procOwner}', "
echo "procUser: '${procUser}'."
fi
done
kolay gele