pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump + cronjob
3+ messages / 3 participants
[nested] [flat]

* pg_dump + cronjob
@ 2003-11-06 11:09  Gerd Terlutter <gerd@MplusB.de>
  0 siblings, 2 replies; 3+ messages in thread

From: Gerd Terlutter @ 2003-11-06 11:09 UTC (permalink / raw)
  To: pgsql-php

Hi list,
i've written a script for dumping several databases (mysql + PG), and it 
runs fine. But now i have the problem to convert it into a cron script. 
how can i run pg_dump with password? i found nothing in the manpages 
about pg login and passwords, e.g. on mysql i can use --password=xxx. 
any ideas how todo this?

Greetings,
Gerd
-- 
--------------------------------------------------------
# Gerd Terlutter         | Mueller+Blanck Software GmbH #
# Gutenbergring 38       | D-22848 Norderstedt          #
# office:+49 40 500 171-1| fax:+49 40 500 171-71        #
--------------------------------------------------------





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_dump + cronjob
@ 2003-11-06 15:00  Bruno Wolff III <bruno@wolff.to>
  parent: Gerd Terlutter <gerd@MplusB.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruno Wolff III @ 2003-11-06 15:00 UTC (permalink / raw)
  To: Gerd Terlutter <gerd@MplusB.de>; +Cc: pgsql-php

On Thu, Nov 06, 2003 at 12:09:26 +0100,
  Gerd Terlutter <gerd@MplusB.de> wrote:
> Hi list,
> i've written a script for dumping several databases (mysql + PG), and it 
> runs fine. But now i have the problem to convert it into a cron script. 
> how can i run pg_dump with password? i found nothing in the manpages 
> about pg login and passwords, e.g. on mysql i can use --password=xxx. 
> any ideas how todo this?

In recent versions you can use a ~/.pgpass file to keep the password.
It is a bad idea to pass passwords on a command line as on most unix
like OS's the argument list can be seen by other people.

If the cron job is running on the same server as postgres, then you
can use either trust or ident authentication for connections over
domain sockets (assuming your OS supports the equivalent of getpeeruid).
ident is probably better to use, but if only trusted users have access
to the box the setup is a little simpler.

The stuff on pgpass seems to be a bit hard to find. It is documented
under libpq rather than for each application that uses libpq.

The following was copied from the 7.4 documentation:

   The file .pgpass in a user's home directory is a file that can contain
   passwords  to  be  used  if the connection requires a password (and no
   password has been specified otherwise). This file should have lines of
   the following format:
hostname:port:database:username:password

   Each  of  the  first  four  fields may be a literal value, or *, which
   matches  anything. The password field from the first line that matches
   the  current  connection  parameters  will  be  used.  (Therefore, put
   more-specific entries first when you are using wildcards.) If an entry
   needs to contain : or \, escape this character with \.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_dump + cronjob
@ 2003-11-06 15:04  Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  parent: Gerd Terlutter <gerd@MplusB.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Christopher Kings-Lynne @ 2003-11-06 15:04 UTC (permalink / raw)
  To: Gerd Terlutter <gerd@MplusB.de>; +Cc: pgsql-php

export PGPASSWORD=mypassword

Chris

On Thu, 6 Nov 2003, Gerd Terlutter wrote:

> Hi list,
> i've written a script for dumping several databases (mysql + PG), and it
> runs fine. But now i have the problem to convert it into a cron script.
> how can i run pg_dump with password? i found nothing in the manpages
> about pg login and passwords, e.g. on mysql i can use --password=xxx.
> any ideas how todo this?
>
> Greetings,
> Gerd
> --
> --------------------------------------------------------
> # Gerd Terlutter         | Mueller+Blanck Software GmbH #
> # Gutenbergring 38       | D-22848 Norderstedt          #
> # office:+49 40 500 171-1| fax:+49 40 500 171-71        #
> --------------------------------------------------------
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-11-06 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-06 11:09 pg_dump + cronjob Gerd Terlutter <gerd@MplusB.de>
2003-11-06 15:00 ` Bruno Wolff III <bruno@wolff.to>
2003-11-06 15:04 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox