Re: db backup script in gentoo - Mailing list pgsql-general

From Scott Marlowe
Subject Re: db backup script in gentoo
Date
Msg-id dcc563d10811291620p640a49dbv13576fd70e0f278@mail.gmail.com
Whole thread Raw
In response to Re: db backup script in gentoo  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: db backup script in gentoo
List pgsql-general
On Sat, Nov 29, 2008 at 3:23 PM, Andrus <kobruleht2@hot.ee> wrote:
> Uwe,
>
> thank you very much. I created script and ran it from command line:
>
> #!/bin/sh
> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> backupdir=/root/my-backups
> backupdate=$(date +%u)
> backupfile=${backupdir}/mybackup${backupdate}.backup
> pg_dump -Fc -b -Z6 mydb >${backupfile}
> /usr/bin/ftp -inp <<EOF
> debug 10
> hash off
> tick on
> open myftpsite.com
> user   myuser mypass
> pwd
> bin
> verbose
> remotestatus
> lcd /root/my-backups
> put "${backupfile}"
> stat
> bye
>
> PGUSER=""
> PGPASSWORD=""
> export PGUSER PGPASSWORD
>
> file /root/my-backups/mybackup6.backup  is created:
>
> ls -l /root/my-backups/mybackup6.backup
> -rw-r--r-- 1 root root 3155454 30. nov   00:06
> /root/my-backups/mybackup6.backup
>
> ftp upload failed:
>
> Output from script:

Are you using ftp or lftp? lftp is much more scriptable / controllable
than regular ftp.

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: db backup script in gentoo
Next
From: Shane Ambler
Date:
Subject: Re: Install question on Mac Leopard Server 10.5