Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Blanket is a flexible backup framework designed to get the drudgery out of the way and to make automated backups easy.
Homepage: http://jimvanfleet.com/projects/blanket
Clone URL: git://github.com/bigfleet/blanket.git
Search Repo:
Rdoc for Postgresql sink. Outlines necessary options and links to the
Postgres manual for more information.
mja (author)
Sat Mar 22 02:42:53 -0700 2008
commit  b88da94f900dbb60033b2c2754b467251dac797b
tree    e9d9ffb058ee674bf64919e50cd115f87da7d74d
parent  58dd1f45ac2dfdee72568cae306b62837b791dc2
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
4
 
5
6
7
8
 
9
10
11
12
13
 
14
15
16
17
 
18
19
20
21
 
22
23
24
25
 
26
27
28
29
 
30
31
32
33
 
34
35
36
37
 
38
39
40
41
 
42
43
44
45
 
46
47
48
49
 
50
51
52
53
 
54
55
56
57
 
58
59
60
61
 
 
62
63
64
65
 
66
67
68
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
27
28
29
30
 
31
32
33
34
35
 
36
37
38
39
 
40
41
42
43
 
44
45
46
47
 
48
49
50
51
 
52
53
54
55
 
56
57
58
59
 
60
61
62
63
 
64
65
66
67
 
68
69
70
71
 
72
73
74
75
 
76
77
78
79
 
80
81
82
83
 
84
85
86
87
88
 
89
90
91
92
0
@@ -1,68 +1,92 @@
0
 require 'date'
0
+
0
+# Source for backing up a PostgreSQL database.
0
+#
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
+#
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
+#
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
+# file.
0
 class Postgresql < Source
0
   
0
- def initialize(reader)
0
+ def initialize(reader) #:nodoc:
0
     @reader = reader
0
   end
0
   
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
   end
0
   
0
- def self.default_source_type
0
+ def self.default_source_type #:nodoc:
0
     "Postgresql"
0
   end
0
   
0
- def self.default_host
0
+ def self.default_host #:nodoc:
0
     "yourhost.com"
0
   end
0
   
0
- def self.default_user
0
+ def self.default_user #:nodoc:
0
     "username"
0
   end
0
   
0
- def self.default_db_user
0
+ def self.default_db_user #:nodoc:
0
     "username"
0
   end
0
   
0
- def self.default_password
0
+ def self.default_password #:nodoc:
0
     "password"
0
   end
0
   
0
- def self.default_db_host
0
+ def self.default_db_host #:nodoc:
0
     "127.0.0.1"
0
   end
0
   
0
- def self.default_database
0
+ def self.default_database #:nodoc:
0
     "test"
0
   end
0
   
0
- def self.default_remote_path
0
+ def self.default_remote_path #:nodoc:
0
     "/path/to/remote/sql-file"
0
   end
0
   
0
- def self.default_local_path
0
+ def self.default_local_path #:nodoc:
0
     "/path/to/local/sql-file"
0
   end
0
   
0
- def self.default_dump_options
0
+ def self.default_dump_options #:nodoc:
0
     "--format=custom"
0
   end
0
   
0
- def remote_backup_path
0
+ def remote_backup_path #:nodoc:
0
     remote_path
0
   end
0
   
0
- def local_backup_path
0
+ def local_backup_path #:nodoc:
0
     local_path
0
   end
0
   
0
- def prep_command
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
   end
0
   
0
- def cleanup_command
0
+ def cleanup_command #:nodoc:
0
     noop
0
   end
0
   

Comments

    No one has commented yet.