From 8f9d5ab0a1a9e20348e7658b4795d1234ae309dd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Sep 2022 15:04:49 +0000 Subject: [PATCH] script updated to avoid issues when running in the customer environment --- postgres-size-report | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/postgres-size-report b/postgres-size-report index d8a9432..ee1b2b6 100755 --- a/postgres-size-report +++ b/postgres-size-report @@ -33,16 +33,14 @@ cd ~postgres echo "" echo "************* Candlepin Tablesizes *************" echo "" -echo $TABLEQUERY | sudo -u postgres psql -d candlepin - +echo $TABLEQUERY | su - postgres -c "psql candlepin" echo "" echo "************** Foreman Tablesizes **************" echo "" -echo $TABLEQUERY | sudo -u postgres psql -d foreman - +echo $TABLEQUERY | su - postgres -c "psql foreman" -if PULPCORE_TABLESIZES=$(echo $TABLEQUERY | sudo -u postgres psql -d pulpcore 2>/dev/null) +if PULPCORE_TABLESIZES=$(echo $TABLEQUERY | su - postgres -c "psql pulpcore" 2>/dev/null) then echo "" echo "************** Pulpcore Tablesizes *************" @@ -50,7 +48,6 @@ then echo "$PULPCORE_TABLESIZES" fi - echo "" echo "*************** FileSystem Usage ***************" echo ""