From: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | Andrus <kobruleht2(at)hot(dot)ee> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: db backup script in gentoo |
Date: | 2008-11-30 00:20:04 |
Message-ID: | dcc563d10811291620p640a49dbv13576fd70e0f278@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sat, Nov 29, 2008 at 3:23 PM, Andrus <kobruleht2(at)hot(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Shane Ambler | 2008-11-30 02:52:02 | Re: Install question on Mac Leopard Server 10.5 |
Previous Message | Andrus | 2008-11-29 22:23:23 | Re: db backup script in gentoo |