<div dir="ltr">My first guess is there is a database named &quot;template1&quot; that is owned by a different user than the one supplied through .dbpass.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>----</div><div>Bob Slaughter</div><div><a href="http://www.facebook.com/robert.s.slaughter" target="_blank">http://www.facebook.com/robert.s.slaughter</a> </div><div>&quot;The price good men pay for indifference to public affairs is to be ruled by evil men.&quot; -- Plato</div><div>&quot;All that is necessary for the triumph of evil is that good men do nothing.&quot; -- Edmund Burke</div><div>&quot;The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing.&quot; -- Albert Einstein</div><div>&quot;Nothing emboldens the wicked so greatly as the lack of courage on the part of the good.&quot; -- Pope Leo XIII, encyclical &#39;On Christians as Citizens&#39;</div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Sep 28, 2015 at 10:35 AM, Beddingfield, Allen <span dir="ltr">&lt;<a href="mailto:allen@ua.edu" target="_blank">allen@ua.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Okay, so I&#39;ve gotten the .pgpass to work without any issue.<br>
The file is in ~/.pgpass, with permissions of 600<br>
<br>
The file looks like:<br>
&lt;hostname&gt;.<a href="http://ua.edu:5432" target="_blank">ua.edu:5432</a>:&lt;dbname&gt;:&lt;user&gt;:&lt;password&gt;<br>
<br>
I can do:<br>
pg_dump -h &lt;hostname&gt;.<a href="http://ua.edu" target="_blank">ua.edu</a> -d &lt;dbname&gt; -U &lt;user&gt; -w<br>
<div><br>
This works, dumping out that database, without prompting for a password.<br>
<br>
I want to be able to do pg_dumpall (I want a one file backup to re-add users, databases, grants, etc...) - similar to a MySQL --all-databases backup.<br>
<br>
When I try:<br>
pg_dumpall -h &lt;hostname&gt;.<a href="http://ua.edu" target="_blank">ua.edu</a> -U &lt;user&gt; -w<br>
<br>
I get:<br>
pg_dumpall: could not connect to database &quot;template1&quot;: fe_sendauth: no password supplied<br>
<br>
Any ideas?<span class=""><br>
<br>
Thanks.<br>
Allen B.<br>
<div style="font-family:Tahoma;font-size:13px">--<br>
Allen Beddingfield<br>
Systems Engineer<br>
The University of Alabama<br>
</div>
</span></div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000" size="2"><b>From:</b> <a href="mailto:ale-bounces@ale.org" target="_blank">ale-bounces@ale.org</a> [<a href="mailto:ale-bounces@ale.org" target="_blank">ale-bounces@ale.org</a>] on behalf of James Sumners [<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>]<br>
<b>Sent:</b> Wednesday, September 23, 2015 4:39 PM<br>
<b>To:</b> Atlanta Linux Enthusiasts<br>
<b>Subject:</b> Re: [ale] Postgreq backup help<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>Or using a pgpass dotfile in the backup user&#39;s home directory. chmod appropriately. <span></span><br>
<br>
On Wednesday, September 23, 2015, Robert Slaughter &lt;<a href="mailto:robert.s.slaughter@gmail.com" target="_blank">robert.s.slaughter@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">You can avoid password prompting by setting the PGPASS environment variable to point to an appropriate file. Google for details I can&#39;t recall.</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><br>
</div>
<div>----</div>
<div>Bob Slaughter</div>
<div><a href="http://www.facebook.com/robert.s.slaughter" target="_blank">http://www.facebook.com/robert.s.slaughter</a> </div>
<div>&quot;The price good men pay for indifference to public affairs is to be ruled by evil men.&quot; -- Plato</div>
<div>&quot;All that is necessary for the triumph of evil is that good men do nothing.&quot; -- Edmund Burke</div>
<div>&quot;The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing.&quot; -- Albert Einstein</div>
<div>&quot;Nothing emboldens the wicked so greatly as the lack of courage on the part of the good.&quot; -- Pope Leo XIII, encyclical &#39;On Christians as Citizens&#39;</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Wed, Sep 23, 2015 at 5:17 PM, Beddingfield, Allen <span dir="ltr">
&lt;<a href="http://UrlBlockedError.aspx" target="_blank">allen@ua.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, after 20 years of being a Unix/Linux admin, I&#39;ve finally got a situation where I need to setup a Postgres server (aside from a few provided-with-the-product cases).  Anyway, I&#39;ve got it all up and running with no issue, but I&#39;m struggling with the best
 way to do a remote backup of the whole server.<br>
In MySQL/MariaDB, I do:<br>
<br>
&quot;mysqldump --host=servername.domain -u username --password &quot;plain text pw&quot; --all-databases &gt; filename.sql&quot;<br>
<br>
I need an equivalent for Postgres.  I&#39;ve discovered that I can do &quot;pg_dump -h servername.domain -U username -W databasename&quot;, that I&#39;m prompted for the password, and it will dump out that database.<br>
<br>
I&#39;ve been experimenting with pg_dumpall, but it dumps a portion, prompts for the password, etc...<br>
<br>
Suggestions/options here?<br>
I have a script I use for MariaDB that dumps out an -all-databases backup, with a date-based naming convention, then handles a 30 day rotation of the backups.  I just want to plug in some pg_dump pg_dumpall into there and do the same.  I would prefer a full
 server backup that will capture users, grants, etc... so that I can put the entire server back from one backup.<br>
<br>
Thanks.<br>
Allen B.<br>
<br>
--<br>
Allen Beddingfield<br>
Systems Engineer<br>
The University of Alabama<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="http://UrlBlockedError.aspx" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
-- <br>
<div dir="ltr">
<div>
<div dir="ltr">
<div>James Sumners<br>
<a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div>
<div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div>
<div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div>
</div>
</div>
</div>
<br>
</div>
</div></div></div>
</div>
</div>

<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div>