Skip to content

Commit 0efb7eb

Browse files
committed
Fixed some bugs in pgbouncer script.
1 parent bfbbbc8 commit 0efb7eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pgbouncer/log_pgbouncer_stats.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ export PGHOST=127.0.0.1
1212
export PGDATABASE=pgbouncer
1313

1414
adddate() {
15+
DTSTAMP=$(date +"%Y-%m-%d %H:%M:%S")
1516
while IFS= read -r line; do
16-
echo "$(date +"%Y-%m-%d %H:%M:%S")|$line"
17+
echo "$DTSTAMP|$line"
1718
done
1819
}
1920

20-
while [ CURMIN -lt NUMMIN ]
21+
while [ $CURMIN -lt $NUMMIN ]
2122
do
2223

2324
psql -q -A -t -c "show pools" | adddate >> pools.log

0 commit comments

Comments
 (0)