0
+# Source for backing up a PostgreSQL database.
0
+# Create a PostgreSQL source by running <code>blanket-cfg</code> with the
0
+# <code>-o Postgresql</code> option. Databases are backed up using
0
+# <code>pg_dump</code> In the source.yml file, set the following options:
0
+# [user] Username on the remote system.
0
+# [password] Password on the remote system.
0
+# [host] Domain name of the remote system.
0
+# [db_user] Database username
0
+# [db_password] Database password
0
+# [db_host] Host name on the remote system that <code>pg_dump</code> should connect to. Usually <code>localhost</code> or <code>127.0.0.1</code>.
0
+# [database] Name of the database to backup.
0
+# [dump_options] Optional arguments to <code>pg_dump</code>. The default is <code>--format=custom</code> which outputs the flexible custom archive. See the manual entry on pg_dump[http://www.postgresql.org/docs/8.3/interactive/app-pgdump.html] for more options.
0
+# [remote_path] The location on the remote server where the database backup file is stored temporarily.
0
+# [local_path] The location on client running the blanket where the database backup is stored before being sent to a sink.
0
+# Because <code>pg_dump</code> does not accept a password, you need to put
0
+# your database password into a .pgpass file in your home directory on the
0
+# server. See the PostgreSQL manual for more information on the
0
+# password[http://www.postgresql.org/docs/8.3/interactive/libpq-pgpass.html]
0
class Postgresql < Source
0
- def initialize(reader)
0
+ def initialize(reader)
#:nodoc:0
- def self.attribute_symbols
0
+ def self.attribute_symbols
#:nodoc:0
[:source_type, :host, :user, :password, :db_user, :db_host,
0
:database, :dump_options, :remote_path, :local_path]
0
- def self.default_source_type
0
+ def self.default_source_type
#:nodoc:0
+ def self.default_host
#:nodoc:0
+ def self.default_user
#:nodoc:0
- def self.default_db_user
0
+ def self.default_db_user
#:nodoc:0
- def self.default_password
0
+ def self.default_password
#:nodoc:0
- def self.default_db_host
0
+ def self.default_db_host
#:nodoc:0
- def self.default_database
0
+ def self.default_database
#:nodoc:0
- def self.default_remote_path
0
+ def self.default_remote_path
#:nodoc:0
"/path/to/remote/sql-file"
0
- def self.default_local_path
0
+ def self.default_local_path
#:nodoc:0
"/path/to/local/sql-file"
0
- def self.default_dump_options
0
+ def self.default_dump_options
#:nodoc:0
- def remote_backup_path
0
+ def remote_backup_path
#:nodoc:0
+ def local_backup_path
#:nodoc:0
+ # Command to prepare the Postgresql backup file. Runs <code>pg_dump</code>.
0
+ def prep_command #:nodoc:
0
"pg_dump #{dump_options} -U #{db_user} -h #{db_host} #{database} > #{remote_backup_path}"
0
+ def cleanup_command
#:nodoc:
Comments
No one has commented yet.