<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Howto Backup PostgreSQL Databases Server With pg_dump command</title> <atom:link href="http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Jasmine</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-177668</link> <dc:creator>Jasmine</dc:creator> <pubDate>Thu, 29 Dec 2011 07:35:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-177668</guid> <description>where should i type that commands?</description> <content:encoded><![CDATA[<p>where should i type that commands?</p> ]]></content:encoded> </item> <item><title>By: Amza Marian</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-172730</link> <dc:creator>Amza Marian</dc:creator> <pubDate>Sun, 24 Jul 2011 21:07:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-172730</guid> <description>You can list dbs with:
&lt;pre&gt;psql -l -t &#124; cut -d&#039;&#124;&#039; -f1 &#124;sed -e &#039;s/ //g&#039;&#124;grep .&lt;/pre&gt;
A great example can be found here: https://www.rtfm.ro/baze-de-date/postgresql/backup-automat-la-bazele-de-date-postgresql/</description> <content:encoded><![CDATA[<p>You can list dbs with:</p><pre>psql -l -t | cut -d'|' -f1 |sed -e 's/ //g'|grep .</pre><p>A great example can be found here: <a
href="https://www.rtfm.ro/baze-de-date/postgresql/backup-automat-la-bazele-de-date-postgresql/" rel="nofollow">https://www.rtfm.ro/baze-de-date/postgresql/backup-automat-la-bazele-de-date-postgresql/</a></p> ]]></content:encoded> </item> <item><title>By: sreemon</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-161650</link> <dc:creator>sreemon</dc:creator> <pubDate>Mon, 06 Dec 2010 13:52:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-161650</guid> <description>Hello,
We were using the PostgreSQL for Bugzill, Now we lost the Password Doc, how can we take the backup of the database,
We have the root password
regards</description> <content:encoded><![CDATA[<p>Hello,</p><p>We were using the PostgreSQL for Bugzill, Now we lost the Password Doc, how can we take the backup of the database,<br
/> We have the root password</p><p>regards</p> ]]></content:encoded> </item> <item><title>By: Nika</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-156244</link> <dc:creator>Nika</dc:creator> <pubDate>Fri, 28 May 2010 16:21:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-156244</guid> <description>Hi,
I&#039;m having problems with script and commands. could you help me with it?
#!/bin/bash
DIR=&quot;/var/lib/pgsql&quot;
BASE=&quot;coupons&quot;
DATE=&quot;date +%m%d&quot;
pg_dump $BASE &#124; gzip &gt; $DATE.coupons.gz
exit</description> <content:encoded><![CDATA[<p>Hi,<br
/> I&#8217;m having problems with script and commands. could you help me with it?</p><p>#!/bin/bash<br
/> DIR=&#8221;/var/lib/pgsql&#8221;<br
/> BASE=&#8221;coupons&#8221;<br
/> DATE=&#8221;date +%m%d&#8221;</p><p>pg_dump $BASE | gzip &gt; $DATE.coupons.gz<br
/> exit</p> ]]></content:encoded> </item> <item><title>By: koco</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-156078</link> <dc:creator>koco</dc:creator> <pubDate>Wed, 19 May 2010 07:55:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-156078</guid> <description>I&#039;ve made some script good for cron... It also has impemented restore commands for created backups :) and expiration limit (rotating)
&lt;pre&gt;
#!/bin/bash
#
# Little script for PGSQLdump all databases (seperate files)
#
# v20100519 -- initial version by Koco
#
############################################################
MYEXECNAME=backup_postgres_v8.4_dbs_script.bash
USER=postgres
PGSQLCMD=&quot;/postgres1/v8.4.0/bin/psql --port 5433&quot;
PGSQLCMDlist=&quot;$PGSQLCMD -l -t&quot;
PGSQLdumpCMD=&quot;/postgres1/v8.4.0/bin/pg_dump --port 5433 -C&quot;
APPEND=`date &quot;+%Y%m%d-%H%M&quot;`
BASEDIR=/postgres1/BACKUPS
BKPDIR=$BASEDIR/bkpV8.4.$APPEND
RSTFILE=$BASEDIR/bkpV8.4.$APPEND/1_restore_commands.README
#How many days do you wanna keep backups
TRESHOLD=30
if [ -f /postgres1/.postvolume ]
then
DATABASES=`su - $USER -c &quot;$PGSQLCMDlist&quot; &#124;grep \&#124; &#124;awk &#039;{ print $1}&#039;&#124; grep -vE &#039;^-&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;`
mkdir $BKPDIR
for db in $DATABASES
do
su - $USER -c &quot;$PGSQLdumpCMD $db&quot; &#124; bzip2 -c &gt; $BKPDIR/$db.dump.bz2
echo &quot;#---restore $db&quot; &gt;&gt; $RSTFILE
echo &quot;bzcat $BKPDIR/$db.dump.bz2 &gt; $BASEDIR/RST.dump.sql&quot; &gt;&gt; $RSTFILE
echo &quot;su - $USER -c \&quot;$PGSQLCMD -d $db -f $BASEDIR/RST.dump.sql\&quot; &quot; &gt;&gt; $RSTFILE
echo &quot;rm $BASEDIR/RST.dump.sql&quot; &gt;&gt; $RSTFILE
echo &quot;#&quot; &gt;&gt; $RSTFILE
done
fi
# And find those old ones... and delete them (use nwrecover if you need them back)
FILES=`find $BASEDIR -type d -name &#039;bkpV8.4.*&#039; -mtime +$TRESHOLD`
for f in $FILES
do
echo &quot;$APPEND: Treshold reached. Removed $f backup.&quot; &gt;&gt; $BASEDIR/$MYEXECNAME.log
rm -rf $f
done
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>I&#8217;ve made some script good for cron&#8230; It also has impemented restore commands for created backups :) and expiration limit (rotating)</p><pre>
#!/bin/bash
#
# Little script for PGSQLdump all databases (seperate files)
#
# v20100519 -- initial version by Koco
#
############################################################
MYEXECNAME=backup_postgres_v8.4_dbs_script.bash
USER=postgres
PGSQLCMD="/postgres1/v8.4.0/bin/psql --port 5433"
PGSQLCMDlist="$PGSQLCMD -l -t"
PGSQLdumpCMD="/postgres1/v8.4.0/bin/pg_dump --port 5433 -C"
APPEND=`date "+%Y%m%d-%H%M"`
BASEDIR=/postgres1/BACKUPS
BKPDIR=$BASEDIR/bkpV8.4.$APPEND
RSTFILE=$BASEDIR/bkpV8.4.$APPEND/1_restore_commands.README
#How many days do you wanna keep backups
TRESHOLD=30
if [ -f /postgres1/.postvolume ]
then
 DATABASES=`su - $USER -c "$PGSQLCMDlist" |grep \| |awk '{ print $1}'| grep -vE '^-|^List|^Name|template[0|1]'`
 mkdir $BKPDIR
 for db in $DATABASES
 do
   su - $USER -c "$PGSQLdumpCMD $db" | bzip2 -c &gt; $BKPDIR/$db.dump.bz2
   echo "#---restore $db" &gt;&gt; $RSTFILE
   echo "bzcat $BKPDIR/$db.dump.bz2 &gt; $BASEDIR/RST.dump.sql" &gt;&gt; $RSTFILE
   echo "su - $USER -c \"$PGSQLCMD -d $db -f $BASEDIR/RST.dump.sql\" " &gt;&gt; $RSTFILE
   echo "rm $BASEDIR/RST.dump.sql" &gt;&gt; $RSTFILE
   echo "#" &gt;&gt; $RSTFILE
 done
fi
# And find those old ones... and delete them (use nwrecover if you need them back)
FILES=`find $BASEDIR -type d -name 'bkpV8.4.*' -mtime +$TRESHOLD`
for f in $FILES
do
  echo "$APPEND: Treshold reached. Removed $f backup." &gt;&gt; $BASEDIR/$MYEXECNAME.log
  rm -rf $f
done
</pre>]]></content:encoded> </item> <item><title>By: Andrew Gudkov</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-155446</link> <dc:creator>Andrew Gudkov</dc:creator> <pubDate>Wed, 28 Apr 2010 21:32:26 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-155446</guid> <description>Even better version :)
&lt;pre&gt;#!/bin/bash
#
# Dayly PostgreSQL maintainance: vacuuming and backuping.
#
##
set -e
for DB in $(psql -l -t -U root &#124; awk &#039;NF &gt;=5 { print $1}&#039; &#124; grep -v template0); do
echo &quot;[`date`] Maintaing $DB&quot;
echo &#039;VACUUM&#039; &#124; psql -U root -d $DB
DUMP=&quot;$DB.`date &#039;+%Y%m%d&#039;`.sql.gz&quot;
PREV=&quot;$DB.`date -d&#039;1 day ago&#039; &#039;+%Y%m%d&#039;`.sql.gz&quot;
pg_dump -U root $DB &#124; gzip -c &gt; $DUMP
md5sum -b $DUMP &gt; $DUMP.md5
if [ -f $PREV.md5 ] &amp;&amp; diff $PREV.md5 $DUMP.md5; then
rm $DUMP $DUMP.md5
fi
done&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Even better version :)</p><pre>#!/bin/bash
#
# Dayly PostgreSQL maintainance: vacuuming and backuping.
#
##
set -e
for DB in $(psql -l -t -U root | awk 'NF &gt;=5 { print $1}' | grep -v template0); do
  echo "[`date`] Maintaing $DB"
  echo 'VACUUM' | psql -U root -d $DB
  DUMP="$DB.`date '+%Y%m%d'`.sql.gz"
  PREV="$DB.`date -d'1 day ago' '+%Y%m%d'`.sql.gz"
  pg_dump -U root $DB | gzip -c &gt; $DUMP
  md5sum -b $DUMP &gt; $DUMP.md5
  if [ -f $PREV.md5 ] &amp;&amp; diff $PREV.md5 $DUMP.md5; then
    rm $DUMP $DUMP.md5
  fi
done</pre>]]></content:encoded> </item> <item><title>By: Andrew Gudkov</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-155443</link> <dc:creator>Andrew Gudkov</dc:creator> <pubDate>Wed, 28 Apr 2010 19:52:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-155443</guid> <description>My version of script. The differencies:
1. I am asking psql to output databases without header (-t)
2. Simplified awk call to get rid of colons
&lt;pre&gt;#!/bin/bash
DIR=/backup/psql
LIST=$(psql -l -t -U root &#124; awk &#039;NF &gt;=5 { print $1}&#039;)
for d in $LIST; do
pg_dump $d &#124; gzip -c &gt;  $DIR/$d.out.gz
done&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>My version of script. The differencies:<br
/> 1. I am asking psql to output databases without header (-t)<br
/> 2. Simplified awk call to get rid of colons</p><pre>#!/bin/bash
DIR=/backup/psql
LIST=$(psql -l -t -U root | awk 'NF &gt;=5 { print $1}')
for d in $LIST; do
  pg_dump $d | gzip -c &gt;  $DIR/$d.out.gz
done</pre>]]></content:encoded> </item> <item><title>By: Tanel</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-154452</link> <dc:creator>Tanel</dc:creator> <pubDate>Mon, 22 Mar 2010 15:18:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-154452</guid> <description>I got errors like this:
-su: /tmp/pgsql/erpengdemo.sql.gz: Permission denied
and tish:
pg_dump: [archiver (db)] connection to database &quot;:&quot; failed: FATAL:  database &quot;:&quot; does not exist
And work around was:
&lt;code&gt;
#!/bin/sh
DIR=/backup/pgsql
[ !$DIR ] &amp;&amp; mkdir -p $DIR &#124;&#124; :
chown postgres:postgres $DIR
LIST=$(su - postgres -c &quot;psql -lt&quot; &#124;awk &#039;{ print $1}&#039; &#124;grep -vE &#039;^-&#124;:&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;)
for d in $LIST
do
su - postgres -c &quot;/usr/bin/pg_dump $d &#124; gzip -c &gt; $DIR/$d.sql.gz&quot;
done
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>I got errors like this:<br
/> -su: /tmp/pgsql/erpengdemo.sql.gz: Permission denied<br
/> and tish:<br
/> pg_dump: [archiver (db)] connection to database &#8220;:&#8221; failed: FATAL:  database &#8220;:&#8221; does not exist</p><p>And work around was:<br
/> <code><br
/> #!/bin/sh<br
/> DIR=/backup/pgsql<br
/> [ !$DIR ] &amp;&amp; mkdir -p $DIR || :</p><p>chown postgres:postgres $DIR</p><p>LIST=$(su - postgres -c "psql -lt" |awk '{ print $1}' |grep -vE '^-|:|^List|^Name|template[0|1]')</p><p>for d in $LIST<br
/> do<br
/> su - postgres -c "/usr/bin/pg_dump $d | gzip -c &gt; $DIR/$d.sql.gz"<br
/> done<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Tanel</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-154451</link> <dc:creator>Tanel</dc:creator> <pubDate>Mon, 22 Mar 2010 15:17:10 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-154451</guid> <description>I got errors like this:
-su: /tmp/pgsql/erpengdemo.sql.gz: Permission denied
and tish:
pg_dump: [archiver (db)] connection to database &quot;:&quot; failed: FATAL:  database &quot;:&quot; does not exist
And work around was:
#!/bin/sh
DIR=/backup/pgsql
[ !$DIR ] &amp;&amp; mkdir -p $DIR &#124;&#124; :
chown postgres:postgres $DIR
LIST=$(su - postgres -c &quot;psql -lt&quot; &#124;awk &#039;{ print $1}&#039; &#124;grep -vE &#039;^-&#124;:&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;)
for d in $LIST
do
su - postgres -c &quot;/usr/bin/pg_dump $d &#124; gzip -c &gt; $DIR/$d.sql.gz&quot;
done</description> <content:encoded><![CDATA[<p>I got errors like this:<br
/> -su: /tmp/pgsql/erpengdemo.sql.gz: Permission denied<br
/> and tish:<br
/> pg_dump: [archiver (db)] connection to database &#8220;:&#8221; failed: FATAL:  database &#8220;:&#8221; does not exist</p><p>And work around was:</p><p>#!/bin/sh<br
/> DIR=/backup/pgsql<br
/> [ !$DIR ] &amp;&amp; mkdir -p $DIR || :</p><p>chown postgres:postgres $DIR</p><p>LIST=$(su &#8211; postgres -c &#8220;psql -lt&#8221; |awk &#8216;{ print $1}&#8217; |grep -vE &#8216;^-|:|^List|^Name|template[0|1]&#8216;)</p><p>for d in $LIST<br
/> do<br
/> su &#8211; postgres -c &#8220;/usr/bin/pg_dump $d | gzip -c &gt; $DIR/$d.sql.gz&#8221;<br
/> done</p> ]]></content:encoded> </item> <item><title>By: nihed</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-153030</link> <dc:creator>nihed</dc:creator> <pubDate>Wed, 20 Jan 2010 10:09:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-153030</guid> <description>Nice,
For my case, I add split to have many files and can store it in dumy filesystem
&lt;code&gt;pg_dumpall -Upostgres &#124; gzip -c &#124; split --bytes=1000m &lt;/code&gt;
Regards</description> <content:encoded><![CDATA[<p>Nice,<br
/> For my case, I add split to have many files and can store it in dumy filesystem<br
/> <code>pg_dumpall -Upostgres | gzip -c | split --bytes=1000m </code></p><p>Regards</p> ]]></content:encoded> </item> <item><title>By: Brahma Prakash Tiwari</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-151507</link> <dc:creator>Brahma Prakash Tiwari</dc:creator> <pubDate>Fri, 06 Nov 2009 10:50:30 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-151507</guid> <description>Hi Denial this script is great for me -Brahma Prakash</description> <content:encoded><![CDATA[<p>Hi Denial this script is great for me -Brahma Prakash</p> ]]></content:encoded> </item> <item><title>By: Ben</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-150612</link> <dc:creator>Ben</dc:creator> <pubDate>Fri, 11 Sep 2009 16:40:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-150612</guid> <description>Hi. I had a slightly different experience. My cron job runs under root, but wanted to run the psql code under postgres user. My script therefore had to be changed to (Note the PGPASSWORD being set AND removed at the end):
#!/bin/bash
export PGPASSWORD=XXXXX
DIR=/home/ben/backups/psql
[ !$DIR ] &amp;&amp; mkdir -p $DIR &#124;&#124; :
LIST=$(su postgres -c &quot;psql -lt&quot; &#124;awk &#039;{ print $1}&#039; &#124;grep -vE &#039;^-&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;)
for d in $LIST
do
pg_dump -U postgres $d &#124; gzip -c &gt;  $DIR/$d.out.gz
done
export PGPASSWORD=</description> <content:encoded><![CDATA[<p>Hi. I had a slightly different experience. My cron job runs under root, but wanted to run the psql code under postgres user. My script therefore had to be changed to (Note the PGPASSWORD being set AND removed at the end):</p><p>#!/bin/bash<br
/> export PGPASSWORD=XXXXX<br
/> DIR=/home/ben/backups/psql<br
/> [ !$DIR ] &amp;&amp; mkdir -p $DIR || :<br
/> LIST=$(su postgres -c &#8220;psql -lt&#8221; |awk &#8216;{ print $1}&#8217; |grep -vE &#8216;^-|^List|^Name|template[0|1]&#8216;)<br
/> for d in $LIST<br
/> do<br
/> pg_dump -U postgres $d | gzip -c &gt;  $DIR/$d.out.gz<br
/> done<br
/> export PGPASSWORD=</p> ]]></content:encoded> </item> <item><title>By: Hamidreza Zarei</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-149692</link> <dc:creator>Hamidreza Zarei</dc:creator> <pubDate>Sun, 26 Jul 2009 07:08:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-149692</guid> <description>Hi
I want take backup from Postgresql in Tehran (city in Iran) and store it in Sqlserver 2005 in Mashad (city in Iran). Is it possible? How can I do it?
Regards,
Hamidreza</description> <content:encoded><![CDATA[<p>Hi<br
/> I want take backup from Postgresql in Tehran (city in Iran) and store it in Sqlserver 2005 in Mashad (city in Iran). Is it possible? How can I do it?<br
/> Regards,<br
/> Hamidreza</p> ]]></content:encoded> </item> <item><title>By: Joe Sircy</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-149418</link> <dc:creator>Joe Sircy</dc:creator> <pubDate>Thu, 09 Jul 2009 17:06:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-149418</guid> <description>Nice tip, thanks. I have a few notes to share.
You can also avoid the number of rows returned with the &quot;-t&quot; option to psql:
psql -lt
Also, to run the script as root from cron, I used su to run the backup as the postgres user.  My complete script:
&lt;pre&gt;
#!/bin/sh
DIR=/backup/pgsql
LIST=$(su - postgres -c &quot;psql -lt&quot; &#124;awk &#039;{ print $1}&#039; &#124;grep -vE &#039;^-&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;)
for d in $LIST
do
su - postgres -c &quot;/usr/bin/pg_dump $d &#124; gzip -c &gt; $DIR/$d.sql.gz&quot;
done
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Nice tip, thanks. I have a few notes to share.</p><p>You can also avoid the number of rows returned with the &#8220;-t&#8221; option to psql:</p><p>psql -lt</p><p>Also, to run the script as root from cron, I used su to run the backup as the postgres user.  My complete script:</p><pre>
#!/bin/sh
DIR=/backup/pgsql
LIST=$(su - postgres -c "psql -lt" |awk '{ print $1}' |grep -vE '^-|^List|^Name|template[0|1]')
for d in $LIST
do
  su - postgres -c "/usr/bin/pg_dump $d | gzip -c &gt; $DIR/$d.sql.gz"
done
</pre>]]></content:encoded> </item> <item><title>By: subodh keskar</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-147989</link> <dc:creator>subodh keskar</dc:creator> <pubDate>Sun, 05 Apr 2009 06:07:53 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-147989</guid> <description>Needed help,new person in software using POSTGRE SQL please guide me with commands that will help to take backup easily and similarly restore when needed.</description> <content:encoded><![CDATA[<p>Needed help,new person in software using POSTGRE SQL please guide me with commands that will help to take backup easily and similarly restore when needed.</p> ]]></content:encoded> </item> <item><title>By: Basavaraj</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-145059</link> <dc:creator>Basavaraj</dc:creator> <pubDate>Sat, 20 Sep 2008 12:27:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-145059</guid> <description>i have taken backup of DB from other machine. so i want the run those DB on my box.
what are the steps i need to follow to achive it.
please help me</description> <content:encoded><![CDATA[<p>i have taken backup of DB from other machine. so i want the run those DB on my box.</p><p>what are the steps i need to follow to achive it.</p><p>please help me</p> ]]></content:encoded> </item> <item><title>By: Stefan</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-144207</link> <dc:creator>Stefan</dc:creator> <pubDate>Sat, 28 Jun 2008 15:37:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-144207</guid> <description>Thanks Vivek for the great script.
Just a few notes:
In the 3rd line
[ ! $DIR ] &amp;&amp; mkdir -p $DIR &#124;&#124; :
there should be no space character after the exclamation mark!
[ !$DIR ] &amp;&amp; mkdir -p $DIR &#124;&#124; :
like this it works for me.
@Leopold, thanks for your comment, I had the same problem and your expression for LIST was the solution :)</description> <content:encoded><![CDATA[<p>Thanks Vivek for the great script.</p><p>Just a few notes:</p><p>In the 3rd line<br
/> [ ! $DIR ] &amp;&amp; mkdir -p $DIR || :<br
/> there should be no space character after the exclamation mark!<br
/> [ !$DIR ] &amp;&amp; mkdir -p $DIR || :<br
/> like this it works for me.</p><p>@Leopold, thanks for your comment, I had the same problem and your expression for LIST was the solution :)</p> ]]></content:encoded> </item> <item><title>By: Leopold Palomo</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-143962</link> <dc:creator>Leopold Palomo</dc:creator> <pubDate>Wed, 04 Jun 2008 19:37:54 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-143962</guid> <description>The script has a little bug. On,
LIST=$(psql -l &#124; awk &#039;{ print $1}&#039; &#124; grep -vE &#039;^-&#124;^List&#124;^Name&#124;template[0&#124;1]&#039;)
if you have a list with several databases, the last row is number. For example in my case:
(19 rows)
and after the script
(19
so I propose you generate the LIST with this:
LIST=$(psql -l &#124; awk &#039;{ print $1}&#039; &#124; grep -vE &#039;^-&#124;^List&#124;^Name&#124;template[0&#124;1]&#124;^\(&#039;)
Otherwise, it&#039;s a very nice article.
Thanks.</description> <content:encoded><![CDATA[<p>The script has a little bug. On,<br
/> LIST=$(psql -l | awk &#8216;{ print $1}&#8217; | grep -vE &#8216;^-|^List|^Name|template[0|1]&#8216;)</p><p>if you have a list with several databases, the last row is number. For example in my case:<br
/> (19 rows)<br
/> and after the script<br
/> (19</p><p>so I propose you generate the LIST with this:<br
/> LIST=$(psql -l | awk &#8216;{ print $1}&#8217; | grep -vE &#8216;^-|^List|^Name|template[0|1]|^\(&#8216;)</p><p>Otherwise, it&#8217;s a very nice article.</p><p>Thanks.</p> ]]></content:encoded> </item> <item><title>By: Daniel</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-143368</link> <dc:creator>Daniel</dc:creator> <pubDate>Thu, 03 Apr 2008 12:37:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-143368</guid> <description>Man, please remember that if you use the gzip option with pg_dumpall you HAVE TO use the gunzip to restore the backup.
gunzip all.dbs.out.gz
and then
psql -f all.dbs.out postgres</description> <content:encoded><![CDATA[<p>Man, please remember that if you use the gzip option with pg_dumpall you HAVE TO use the gunzip to restore the backup.</p><p>gunzip all.dbs.out.gz</p><p>and then</p><p>psql -f all.dbs.out postgres</p> ]]></content:encoded> </item> <item><title>By: Yogesh</title><link>http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-140258</link> <dc:creator>Yogesh</dc:creator> <pubDate>Wed, 20 Jun 2007 07:25:16 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html#comment-140258</guid> <description>can you provide how to do offiline backup of the postgresql database.</description> <content:encoded><![CDATA[<p>can you provide how to do offiline backup of the postgresql database.</p> ]]></content:encoded> </item> </channel> </rss>
