Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/puppet_enterprise_database_backup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

usage() {
echo "usage: $0 [-t BACKUP_TARGET] [-l LOG_DIRECTORY] [-r retention] <DATABASE> [DATABASE_N ...]"
echo "usage: $0 [-t TARGET_BACKUP_DIRECTORY] [-l LOG_DIRECTORY] [-r RETENTION] <DATABASE> [DATABASE_N ...]"
exit 1
}

Expand Down
8 changes: 4 additions & 4 deletions files/vacuum_full_tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

usage() {
cat <<EOF
echo "usage: $0 <table set> [sleep duration]"
where <table set> is one of: facts catalogs other
and [sleep duration] is an optional integer of seconds to sleep. Defaults to 300
echo "usage: $0 <TABLE_SET> [SLEEP_DURATION]"
where <TABLE_SET> is one of: facts catalogs other
and [SLEEP_DURATION] is an optional integer of seconds to sleep. Defaults to 300
EOF
exit 1
}
Expand All @@ -27,14 +27,14 @@ case "$1" in
usage
esac


SQL="SELECT t.relname::varchar AS table_name
FROM pg_class t
JOIN pg_namespace n
ON n.oid = t.relnamespace
WHERE t.relkind = 'r'
AND t.relname IN ( $(IFS=,; echo "${vacuum_tables[*]}") )"

# shellcheck disable=SC2207
tables=($(su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/psql -d pe-puppetdb -c \"$SQL\" --tuples-only"))

for table in "${tables[@]}"; do
Expand Down