Re: db backup script in gentoo

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: db backup script in gentoo
Date: 2008-11-29 22:23:23
Message-ID: ggsfh7$1846$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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:

Debugging on (debug=10).
Hash mark printing on (1024 bytes/hash mark).
Hash mark printing off.
Tick counter printing on (10240 bytes/tick increment).
---> SYST
---> USER myuser
---> PASS XXXX
?Invalid command
?Invalid command
---> PWD
257 "/" is your current location
---> TYPE I
Verbose mode on.
?Invalid command
Local directory now /root/my-backups
local: /root/my-backups/mybackup6.backup remote:
/root/my-backups/mybackup6.backup
---> PASV
227 Entering Passive Mode (195,222,29,12,236,175)
---> STOR /root/my-backups/mybackup6.backup
553-Can't open that file: No such file or directory
553 Rename/move failure: No such file or directory
Connected tomyftpsite.com.
No proxy connection.
Mode: stream; Type: binary; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: off; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
Tick counter printing: on
---> QUIT
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.

Why created fiel is not found ?
How to fix ?

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-11-30 00:20:04 Re: db backup script in gentoo
Previous Message ries van Twisk 2008-11-29 21:22:54 Re: Install question on Mac Leopard Server 10.5