File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
33usage () {
4- echo " usage: $0 [-t BACKUP_TARGET ] [-l LOG_DIRECTORY] [-r retention ] <DATABASE> [DATABASE_N ...]"
4+ echo " usage: $0 [-t TARGET_BACKUP_DIRECTORY ] [-l LOG_DIRECTORY] [-r RETENTION ] <DATABASE> [DATABASE_N ...]"
55 exit 1
66}
77
Original file line number Diff line number Diff line change 22
33usage () {
44 cat << EOF
5- echo "usage: $0 <table set > [sleep duration ]"
6- where <table set > is one of: facts catalogs other
7- and [sleep duration ] is an optional integer of seconds to sleep. Defaults to 300
5+ echo "usage: $0 <TABLE_SET > [SLEEP_DURATION ]"
6+ where <TABLE_SET > is one of: facts catalogs other
7+ and [SLEEP_DURATION ] is an optional integer of seconds to sleep. Defaults to 300
88EOF
99 exit 1
1010}
@@ -27,14 +27,14 @@ case "$1" in
2727 usage
2828esac
2929
30-
3130SQL=" SELECT t.relname::varchar AS table_name
3231 FROM pg_class t
3332 JOIN pg_namespace n
3433 ON n.oid = t.relnamespace
3534 WHERE t.relkind = 'r'
3635 AND t.relname IN ( $( IFS=,; echo " ${vacuum_tables[*]} " ) )"
3736
37+ # shellcheck disable=SC2207
3838tables=($( su - pe-postgres -s /bin/bash -c " /opt/puppetlabs/server/bin/psql -d pe-puppetdb -c \" $SQL \" --tuples-only" ) )
3939
4040for table in " ${tables[@]} " ; do
You can’t perform that action at this time.
0 commit comments