diff --git a/templates/psql.sh.erb b/templates/psql.sh.erb index 0f3f9ab..77fdd15 100644 --- a/templates/psql.sh.erb +++ b/templates/psql.sh.erb @@ -7,12 +7,12 @@ host=<%=@host%> user=<%=@dbbackup_user%> pass=<%=@dbbackup_password%> -PGPASSWORD="$pass" +#PGPASSWORD="$pass" dbs=( - $(ssh -l <%=@backup_user-%> "$host" "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=${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-%>'\"") ) for db in "${dbs[@]}"; do - ssh -l <%=@backup_user-%> "$host" "<%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql + ssh -l <%=@backup_user-%> "$host" "PGPASSWORD=${pass} <%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql wait <% if @compress != '' -%> <%=@compress-%> "$db".sql