Re: Timestamp in pg_dump output, was Re: How I can know a back up database is up to date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- phoenix.kiula@xxxxxxxxx wrote:
> > If you need to, you can append your own timestamp to the dump file if you need it.
> >
> > I rolled this functionality into a .bat file.
> 
> Hi could you please share how you automated the pg_dump in the command
> line. It seems to always want the password, but I would like to put it
> all in a cronjob, so I would like to specify a password. Can pg_dump
> read from a file of options? The pg_dump page did not seem to suggest
> so. Thanks!

Be sure to include the postgres mailing list so that other can chime in. This is important since
my level of understanding is between novice to intermediate.  So others on this like may offer
better alternatives to my suggestions or may even go as far as correcting my viewpoint on a
particular matter.

Are you running on windows or linux?  

The solution that I've pieced together was designed to mimic on windows the common linux task of
calling shell scripts called by the cron deamon.  In my solution, I use a DOS batch file that is
called by the windows scheduler.  However, for both solutions ( either on linux or windows) to
work you need to have a trusted OS user ( i.e. root / postgres / or Administrator ) call pg_dump
or pg_dumpall and specify a DB user with suffient priveldges like the DB user postgres that have
the rights to access the entire DB/Cluster schema.

The only problem is that by default, all DB user will try to authenticate WITH a password.  There
are two ways to over come this.  The recommended way is to use a .pgpass file which is described
on this link:
http://www.postgresql.org/docs/8.2/static/libpq-pgpass.html

The other method that requires you to restart your server is to modity your pg_hba.conf as add and
entry to allow one of your OS users to log into any/all of you databases without needing a
password.

http://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html
http://www.postgresql.org/docs/8.2/static/auth-methods.html#AUTH-TRUST

If you are also interested in developing a shell script or batch file that you can call from a
cron or scheduler, I can provide some ideas if you are enterested.

Regards,
Richard Broersma Jr.



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux