Skip to content

Commit

Permalink
Removed fully qualified pathname for psql.
Browse files Browse the repository at this point in the history
  • Loading branch information
Susan Steinpreis committed May 20, 2010
1 parent 7bf9628 commit 9e6a469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion table_growth/table_growth_report.sh
Expand Up @@ -11,7 +11,7 @@
LOGFILE=/home/postgres/logs/table_growth.rpt
DNAME=your_real_postgres_db_name

/opt/pgsql90alpha4/bin/psql -d ${DNAME} -c "select 'Top 10 Tables Growth For:- '||to_char(current_date - '1 month'::interval,'Mon-YYYY') as Month; select table_owner, schema_name, table_name, pg_size_pretty(growth_size::bigint) as Growth_size_MB from otools.table_growth where sum_flag = 2 and to_char(capture_time,'mm/yyyy')=to_char((current_date - '1 month'::interval),'mm/yyyy') order by growth_size desc limit 10;" > $LOGFILE
psql -d ${DNAME} -c "select 'Top 10 Tables Growth For:- '||to_char(current_date - '1 month'::interval,'Mon-YYYY') as Month; select table_owner, schema_name, table_name, pg_size_pretty(growth_size::bigint) as Growth_size_MB from otools.table_growth where sum_flag = 2 and to_char(capture_time,'mm/yyyy')=to_char((current_date - '1 month'::interval),'mm/yyyy') order by growth_size desc limit 10;" > $LOGFILE

if [ -s "$LOGFILE" ]; then
M_HOSTNAME=$(hostname)'.'$(cat /etc/resolv.conf | grep domain | cut -f2 -d' ')
Expand Down

0 comments on commit 9e6a469

Please sign in to comment.