mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-11-13 01:00:34 +00:00
Merge branch 'develop'
This commit is contained in:
commit
98519a8ebc
@ -5,7 +5,6 @@
|
|||||||
#
|
#
|
||||||
host=<%=@host%>
|
host=<%=@host%>
|
||||||
user=<%=@dbbackup_user%>
|
user=<%=@dbbackup_user%>
|
||||||
pass=<%=@dbbackup_password%>
|
|
||||||
|
|
||||||
<% if (@dbbackup_user == 'root' && @dbbackup_password == '') -%>
|
<% if (@dbbackup_user == 'root' && @dbbackup_password == '') -%>
|
||||||
dbs=(
|
dbs=(
|
||||||
|
@ -5,14 +5,12 @@
|
|||||||
#
|
#
|
||||||
host=<%=@host%>
|
host=<%=@host%>
|
||||||
user=<%=@dbbackup_user%>
|
user=<%=@dbbackup_user%>
|
||||||
pass=<%=@dbbackup_password%>
|
|
||||||
|
|
||||||
#PGPASSWORD="$pass"
|
|
||||||
dbs=(
|
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
|
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
|
wait
|
||||||
<% if @compress != '' -%>
|
<% if @compress != '' -%>
|
||||||
<%=@compress-%> "$db".sql
|
<%=@compress-%> "$db".sql
|
||||||
|
Loading…
Reference in New Issue
Block a user