Thread

  1. automated pg_dump

    Raphael Bauduin <raphael@be.easynet.net> — 2002-01-22T11:46:01Z

    Hi,
    
    is there a way to make an automated dump with pg_dump when the database 
    access is password protected?
    I'd like to run it from a cron. However, I haven't found a way to 
    mention the password on the command line (Which is
    not the most secure solution, but needed to run it non interactively 
    from a script).
    
    Thanks for your help!
    
    Raph
    
    
    
  2. Re: automated pg_dump

    Lukas Ertl <l.ertl@univie.ac.at> — 2002-01-22T12:11:20Z

    On Tue, 22 Jan 2002, Raphael Bauduin wrote:
    
    > is there a way to make an automated dump with pg_dump when the database
    > access is password protected?
    > I'd like to run it from a cron. However, I haven't found a way to
    
    I do a daily backup with a shell script like this:
    
    ---8<---
    #!/bin/sh
    
    export PGUSER=<username>
    export PGPASSWORD=<password>
    
    /usr/local/bin/pg_dumpall > dump.sql
    ---8<---
    
    This should be definitely more documented, as it took me also quite long
    to find out :-)
    
    regards,
    le
    
    -- 
    Lukas Ertl                             eMail: l.ertl@univie.ac.at
    UNIX-Systemadministrator               Tel.:  (+43 1) 4277-14073
    Zentraler Informatikdienst (ZID)       Fax.:  (+43 1) 4277-9140
    der Universität Wien                   http://mailbox.univie.ac.at/~le/