On 05/06/2013 03:16 PM, Kamil Jońca wrote:
I tried to use ampgsql to backup mu "personal" database cluster (over a
dozen GBs) finally I think, I did it, but there is some ambiguity for
me.
I used
http://wiki.zmanda.com/man/ampgsql.8.html
http://wiki.zmanda.com/index.php/How_To:Use_Amanda_to_Back_Up_PostgreSQL
as a reference. (I used debian's 1:3.3.3-1 version)

My first config (excerpts)
[...]
amanda.conf
--8<---------------cut here---------------start------------->8---
define dumptype gnutar {
     program "GNUTAR"
}
define dumptype gnutar-local {
     gnutar
     auth "local"
}

define application-tool app-ampgsql {
     comment "ampgsql"
     plugin "ampgsql"
     property "ARCHIVEDIR" "/var/lib/postgresql/archive"
     property "TMPDIR" "/tmp/ampgsql"
     property "DIRECTORY" "/tmp/amanda-pgsql/"
     property "HOST" "/var/run/postgresql/"
     property "USER" "backup"
}

define dumptype ampgsql-local {
     gnutar-local                  # You might need this if you're setting 'auth 
"bsdtcp"' in your global dumptype settings, for example
program "APPLICATION"
     application "app-ampgsql"
     property "PG-ARCHIVEDIR" "/var/lib/postgresql/archive"
     property "PG-DATADIR" "/var/lib/postgresql/9.1/main"

}
--8<---------------cut here---------------end--------------->8---
This create two properties of the dumptype, you want application properties:
It is a bug to use the 'PG-' prefix on the application properties.
The 'PG-' prefix must be use only if you define the properties in amanda-client.conf, don't do it, it is deprecated.

define dumptype ampgsql-local {
    gnutar-local                  # You might need this if you're setting 'auth 
"bsdtcp"' in your global dumptype settings, for example
program "APPLICATION"
    application {
       app-ampgsql
       property "ARCHIVEDIR" "/var/lib/postgresql/archive"  # not required, it 
is set in app-ampgsql
       property "DATADIR" "/var/lib/postgresql/9.1/main"    # you could set it 
in app-ampgsql
    }
}




disklist
--8<---------------cut here---------------start------------->8---
localhost postgres  ampgsql-local
--8<---------------cut here---------------end--------------->8---

(example from howto was  foo.example.com bar dt_ampgsql)

But this did not work :(

After read some debug and log files I found that tar called from ampgsql
tries to backup "postrgresql" dir which was clearly wrong.
then I changed disklist to

--8<---------------cut here---------------start------------->8---
localhost postgres /var/lib/postgresql/9.1/main ampgsql-local
--8<---------------cut here---------------end--------------->8---

And this seems to work. (At least dump contents looks reasonable)
But
1. Am I misssed something about cluster data dir in dikslist?
2. If I have to use diskdevice in disklist entry - what for is "PG-DATADIR"?

Either the diskdevice in disklist or the DATADIR application property.

Jean-Louis

Reply via email to