File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ usage () {
4
+ echo " usage: $0 [-t BACKUP_TARGET] [-l LOG_DIRECTORY] [-r retention] <DATABASE> [DATABASE_N ...]"
5
+ exit 1
6
+ }
7
+
3
8
while [[ $1 ]]; do
4
9
case " $1 " in
5
10
-t)
30
35
databases=(" $@ " )
31
36
# shellcheck disable=SC2128
32
37
# We only care if the array contains any elements
33
- [[ $databases ]] || {
34
- echo " Usage: $0 [-t BACKUP_TARGET] [-l LOG_DIRECTORY] [-r retention] <DATABASE> [DATABASE_N ...]"
35
- exit 1
36
- }
38
+ [[ $databases ]] || usage
37
39
38
40
[[ $pg_version ]] || pg_version=" $( /usr/local/bin/facter -p pe_postgresql_info.installed_server_version) "
39
41
backup_dir=" ${backup_dir:-/ opt/ puppetlabs/ server/ data/ postgresql/ $pg_version / backups} "
@@ -64,7 +66,6 @@ for db in "${databases[@]}"; do
64
66
rm -f -- " ${backups[@]: 0: $offset } "
65
67
fi
66
68
67
-
68
69
echo " Starting dump of database: $db "
69
70
70
71
if [[ $db == ' pe-classifier' ]]; then
Original file line number Diff line number Diff line change 2
2
3
3
usage () {
4
4
cat << EOF
5
- echo "usage: $0 <table>"
6
- where <table> is one of: facts catalogs other
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
7
8
EOF
8
9
exit 1
9
10
}
12
13
13
14
sleep_duration=" ${2:- 300} "
14
15
15
- # TODO: Is this used in PE 2018 and newer? RE: fact_values
16
16
case " $1 " in
17
17
' facts' )
18
18
vacuum_tables=(" 'facts'" " 'factsets'" " 'fact_paths'" " 'fact_values'" )
You can’t perform that action at this time.
0 commit comments