mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-11-10 00:00:35 +00:00
Merge branch 'develop'
This commit is contained in:
commit
98519a8ebc
@ -5,7 +5,6 @@
|
||||
#
|
||||
host=<%=@host%>
|
||||
user=<%=@dbbackup_user%>
|
||||
pass=<%=@dbbackup_password%>
|
||||
|
||||
<% if (@dbbackup_user == 'root' && @dbbackup_password == '') -%>
|
||||
dbs=(
|
||||
|
@ -5,14 +5,12 @@
|
||||
#
|
||||
host=<%=@host%>
|
||||
user=<%=@dbbackup_user%>
|
||||
pass=<%=@dbbackup_password%>
|
||||
|
||||
#PGPASSWORD="$pass"
|
||||
dbs=(
|
||||
$(ssh -l <%=@backup_user-%> "$host" "PGPASSWORD=${pass} psql -U ${user} -Atc \"SELECT datname FROM pg_database WHERE NOT datistemplate AND NOT datname ~ '<%@ignore_dbs.each do |db|-%><%if db == @ignore_dbs.last-%><%=db-%><%else-%><%=db-%>|<%end-%><%end-%>'\"")
|
||||
$(ssh -l <%=@backup_user-%> "$host" "PGPASSWORD='<%=@dbbackup_password%>' psql -U ${user} -Atc \"SELECT datname FROM pg_database WHERE NOT datistemplate AND NOT datname ~ '<%@ignore_dbs.each do |db|-%><%if db == @ignore_dbs.last-%><%=db-%><%else-%><%=db-%>|<%end-%><%end-%>'\"")
|
||||
)
|
||||
for db in "${dbs[@]}"; do
|
||||
ssh -l <%=@backup_user-%> "$host" "PGPASSWORD=${pass} <%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql
|
||||
ssh -l <%=@backup_user-%> "$host" "PGPASSWORD='<%=@dbbackup_password%>' <%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql
|
||||
wait
|
||||
<% if @compress != '' -%>
|
||||
<%=@compress-%> "$db".sql
|
||||
|
Loading…
Reference in New Issue
Block a user