backup 2.4.4 → 2.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/backup/adapters/postgresql.rb +7 -3
- data/lib/backup/version.rb +1 -1
- data/setup/backup.rb +4 -2
- metadata +68 -144
@@ -2,7 +2,7 @@ module Backup
|
|
2
2
|
module Adapters
|
3
3
|
class PostgreSQL < Backup::Adapters::Base
|
4
4
|
|
5
|
-
attr_accessor :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options
|
5
|
+
attr_accessor :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options, :su_as_user
|
6
6
|
|
7
7
|
private
|
8
8
|
|
@@ -10,7 +10,11 @@ module Backup
|
|
10
10
|
def perform
|
11
11
|
log system_messages[:pgdump]; log system_messages[:compressing]
|
12
12
|
ENV['PGPASSWORD'] = password
|
13
|
-
|
13
|
+
if su_as_user
|
14
|
+
run "su #{su_as_user} -c \"#{pg_dump} -U #{user} #{options} #{additional_options} #{tables_to_skip} #{database} | gzip -f --best > #{File.join(tmp_path, compressed_file)}\""
|
15
|
+
else
|
16
|
+
run "#{pg_dump} -U #{user} #{options} #{additional_options} #{tables_to_skip} #{database} | gzip -f --best > #{File.join(tmp_path, compressed_file)}"
|
17
|
+
end
|
14
18
|
ENV['PGPASSWORD'] = nil
|
15
19
|
end
|
16
20
|
|
@@ -27,7 +31,7 @@ module Backup
|
|
27
31
|
|
28
32
|
# Loads the initial settings
|
29
33
|
def load_settings
|
30
|
-
%w(user password database skip_tables additional_options).each do |attribute|
|
34
|
+
%w(user password database skip_tables additional_options su_as_user).each do |attribute|
|
31
35
|
send(:"#{attribute}=", procedure.get_adapter_configuration.attributes[attribute])
|
32
36
|
end
|
33
37
|
|
data/lib/backup/version.rb
CHANGED
data/setup/backup.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 4
|
9
|
-
- 4
|
10
|
-
version: 2.4.4
|
4
|
+
prerelease:
|
5
|
+
version: 2.4.5
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Michael van Rooijen
|
@@ -15,184 +10,119 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date:
|
13
|
+
date: 2011-02-07 00:00:00 +01:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
17
|
+
name: json_pure
|
23
18
|
prerelease: false
|
24
19
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
20
|
none: false
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 3
|
33
|
-
- 5
|
34
|
-
version: 0.3.5
|
24
|
+
version: 1.4.6
|
35
25
|
type: :runtime
|
36
26
|
version_requirements: *id001
|
37
27
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
28
|
+
name: net-ssh
|
39
29
|
prerelease: false
|
40
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
31
|
none: false
|
42
32
|
requirements:
|
43
|
-
- -
|
33
|
+
- - ">="
|
44
34
|
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 4
|
49
|
-
- 6
|
50
|
-
version: 1.4.6
|
35
|
+
version: 2.0.15
|
51
36
|
type: :runtime
|
52
37
|
version_requirements: *id002
|
53
38
|
- !ruby/object:Gem::Dependency
|
54
|
-
name: net-
|
39
|
+
name: net-scp
|
55
40
|
prerelease: false
|
56
41
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
42
|
none: false
|
58
43
|
requirements:
|
59
44
|
- - ">="
|
60
45
|
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 2
|
64
|
-
- 0
|
65
|
-
- 15
|
66
|
-
version: 2.0.15
|
46
|
+
version: 1.0.2
|
67
47
|
type: :runtime
|
68
48
|
version_requirements: *id003
|
69
49
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: net-
|
50
|
+
name: net-sftp
|
71
51
|
prerelease: false
|
72
52
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
53
|
none: false
|
74
54
|
requirements:
|
75
55
|
- - ">="
|
76
56
|
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 0
|
81
|
-
- 2
|
82
|
-
version: 1.0.2
|
57
|
+
version: 2.0.4
|
83
58
|
type: :runtime
|
84
59
|
version_requirements: *id004
|
85
60
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
61
|
+
name: activerecord
|
87
62
|
prerelease: false
|
88
63
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
64
|
none: false
|
90
65
|
requirements:
|
91
66
|
- - ">="
|
92
67
|
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
segments:
|
95
|
-
- 2
|
96
|
-
- 0
|
97
|
-
- 4
|
98
|
-
version: 2.0.4
|
68
|
+
version: 2.3.5
|
99
69
|
type: :runtime
|
100
70
|
version_requirements: *id005
|
101
71
|
- !ruby/object:Gem::Dependency
|
102
|
-
name:
|
72
|
+
name: hirb
|
103
73
|
prerelease: false
|
104
74
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
75
|
none: false
|
106
76
|
requirements:
|
107
77
|
- - ">="
|
108
78
|
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
segments:
|
111
|
-
- 2
|
112
|
-
- 3
|
113
|
-
- 5
|
114
|
-
version: 2.3.5
|
79
|
+
version: 0.2.9
|
115
80
|
type: :runtime
|
116
81
|
version_requirements: *id006
|
117
82
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
83
|
+
name: pony
|
119
84
|
prerelease: false
|
120
85
|
requirement: &id007 !ruby/object:Gem::Requirement
|
121
86
|
none: false
|
122
87
|
requirements:
|
123
88
|
- - ">="
|
124
89
|
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
segments:
|
127
|
-
- 1
|
128
|
-
- 2
|
129
|
-
- 5
|
130
|
-
version: 1.2.5
|
90
|
+
version: "0.5"
|
131
91
|
type: :runtime
|
132
92
|
version_requirements: *id007
|
133
93
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
94
|
+
name: cloudfiles
|
135
95
|
prerelease: false
|
136
96
|
requirement: &id008 !ruby/object:Gem::Requirement
|
137
97
|
none: false
|
138
98
|
requirements:
|
139
99
|
- - ">="
|
140
100
|
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
segments:
|
143
|
-
- 0
|
144
|
-
- 2
|
145
|
-
- 9
|
146
|
-
version: 0.2.9
|
101
|
+
version: 1.4.7
|
147
102
|
type: :runtime
|
148
103
|
version_requirements: *id008
|
149
104
|
- !ruby/object:Gem::Dependency
|
150
|
-
name:
|
105
|
+
name: dropbox
|
151
106
|
prerelease: false
|
152
107
|
requirement: &id009 !ruby/object:Gem::Requirement
|
153
108
|
none: false
|
154
109
|
requirements:
|
155
110
|
- - ">="
|
156
111
|
- !ruby/object:Gem::Version
|
157
|
-
|
158
|
-
segments:
|
159
|
-
- 0
|
160
|
-
- 5
|
161
|
-
version: "0.5"
|
112
|
+
version: 1.1.2
|
162
113
|
type: :runtime
|
163
114
|
version_requirements: *id009
|
164
115
|
- !ruby/object:Gem::Dependency
|
165
|
-
name:
|
116
|
+
name: fog
|
166
117
|
prerelease: false
|
167
118
|
requirement: &id010 !ruby/object:Gem::Requirement
|
168
119
|
none: false
|
169
120
|
requirements:
|
170
|
-
- -
|
121
|
+
- - ~>
|
171
122
|
- !ruby/object:Gem::Version
|
172
|
-
|
173
|
-
segments:
|
174
|
-
- 1
|
175
|
-
- 4
|
176
|
-
- 7
|
177
|
-
version: 1.4.7
|
123
|
+
version: 0.3.5
|
178
124
|
type: :runtime
|
179
125
|
version_requirements: *id010
|
180
|
-
- !ruby/object:Gem::Dependency
|
181
|
-
name: dropbox
|
182
|
-
prerelease: false
|
183
|
-
requirement: &id011 !ruby/object:Gem::Requirement
|
184
|
-
none: false
|
185
|
-
requirements:
|
186
|
-
- - ">="
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
hash: 23
|
189
|
-
segments:
|
190
|
-
- 1
|
191
|
-
- 1
|
192
|
-
- 2
|
193
|
-
version: 1.1.2
|
194
|
-
type: :runtime
|
195
|
-
version_requirements: *id011
|
196
126
|
description: |-
|
197
127
|
Backup is a Ruby Gem written for Unix and Ruby on Rails (2 and 3) environments. It can be used both with
|
198
128
|
and without the Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases
|
@@ -210,61 +140,61 @@ files:
|
|
210
140
|
- README.md
|
211
141
|
- CHANGELOG
|
212
142
|
- LICENSE
|
213
|
-
- lib/
|
214
|
-
- lib/
|
215
|
-
- lib/
|
216
|
-
- lib/
|
217
|
-
- lib/
|
143
|
+
- lib/backup/adapters/archive.rb
|
144
|
+
- lib/backup/adapters/base.rb
|
145
|
+
- lib/backup/adapters/custom.rb
|
146
|
+
- lib/backup/adapters/mongo_db.rb
|
147
|
+
- lib/backup/adapters/mysql.rb
|
148
|
+
- lib/backup/adapters/postgresql.rb
|
149
|
+
- lib/backup/adapters/sqlite.rb
|
150
|
+
- lib/backup/command_helper.rb
|
151
|
+
- lib/backup/configuration/adapter.rb
|
152
|
+
- lib/backup/configuration/adapter_options.rb
|
153
|
+
- lib/backup/configuration/attributes.rb
|
154
|
+
- lib/backup/configuration/base.rb
|
155
|
+
- lib/backup/configuration/helpers.rb
|
156
|
+
- lib/backup/configuration/mail.rb
|
157
|
+
- lib/backup/configuration/smtp.rb
|
158
|
+
- lib/backup/configuration/storage.rb
|
159
|
+
- lib/backup/connection/cloudfiles.rb
|
160
|
+
- lib/backup/connection/dropbox.rb
|
161
|
+
- lib/backup/connection/s3.rb
|
162
|
+
- lib/backup/core_ext/object.rb
|
163
|
+
- lib/backup/environment/base.rb
|
164
|
+
- lib/backup/environment/rails_configuration.rb
|
165
|
+
- lib/backup/environment/unix_configuration.rb
|
166
|
+
- lib/backup/mail/base.rb
|
167
|
+
- lib/backup/mail/mail.txt
|
168
|
+
- lib/backup/record/base.rb
|
169
|
+
- lib/backup/record/cloudfiles.rb
|
218
170
|
- lib/backup/record/dropbox.rb
|
171
|
+
- lib/backup/record/ftp.rb
|
172
|
+
- lib/backup/record/local.rb
|
219
173
|
- lib/backup/record/s3.rb
|
220
174
|
- lib/backup/record/scp.rb
|
221
|
-
- lib/backup/record/cloudfiles.rb
|
222
|
-
- lib/backup/record/base.rb
|
223
|
-
- lib/backup/record/ftp.rb
|
224
175
|
- lib/backup/record/sftp.rb
|
225
|
-
- lib/backup/
|
226
|
-
- lib/backup/
|
227
|
-
- lib/backup/connection/s3.rb
|
228
|
-
- lib/backup/connection/cloudfiles.rb
|
229
|
-
- lib/backup/mail/mail.txt
|
230
|
-
- lib/backup/mail/base.rb
|
231
|
-
- lib/backup/command_helper.rb
|
176
|
+
- lib/backup/storage/base.rb
|
177
|
+
- lib/backup/storage/cloudfiles.rb
|
232
178
|
- lib/backup/storage/dropbox.rb
|
179
|
+
- lib/backup/storage/ftp.rb
|
180
|
+
- lib/backup/storage/local.rb
|
233
181
|
- lib/backup/storage/s3.rb
|
234
182
|
- lib/backup/storage/scp.rb
|
235
|
-
- lib/backup/storage/cloudfiles.rb
|
236
|
-
- lib/backup/storage/base.rb
|
237
|
-
- lib/backup/storage/ftp.rb
|
238
183
|
- lib/backup/storage/sftp.rb
|
239
|
-
- lib/backup/storage/local.rb
|
240
|
-
- lib/backup/environment/rails_configuration.rb
|
241
|
-
- lib/backup/environment/unix_configuration.rb
|
242
|
-
- lib/backup/environment/base.rb
|
243
184
|
- lib/backup/version.rb
|
244
|
-
- lib/backup/adapters/custom.rb
|
245
|
-
- lib/backup/adapters/postgresql.rb
|
246
|
-
- lib/backup/adapters/mysql.rb
|
247
|
-
- lib/backup/adapters/sqlite.rb
|
248
|
-
- lib/backup/adapters/archive.rb
|
249
|
-
- lib/backup/adapters/mongo_db.rb
|
250
|
-
- lib/backup/adapters/base.rb
|
251
|
-
- lib/backup/configuration/attributes.rb
|
252
|
-
- lib/backup/configuration/smtp.rb
|
253
|
-
- lib/backup/configuration/mail.rb
|
254
|
-
- lib/backup/configuration/adapter_options.rb
|
255
|
-
- lib/backup/configuration/storage.rb
|
256
|
-
- lib/backup/configuration/adapter.rb
|
257
|
-
- lib/backup/configuration/base.rb
|
258
|
-
- lib/backup/configuration/helpers.rb
|
259
|
-
- lib/backup/core_ext/object.rb
|
260
185
|
- lib/backup.rb
|
186
|
+
- lib/generators/backup/backup_generator.rb
|
187
|
+
- lib/generators/backup/templates/backup.rake
|
188
|
+
- lib/generators/backup/templates/backup.rb
|
189
|
+
- lib/generators/backup/templates/create_backup_tables.rb
|
190
|
+
- lib/generators/backup/USAGE
|
261
191
|
- bin/backup
|
262
|
-
- generators/
|
263
|
-
- generators/backup_update/templates/migrations/update_backup_tables.rb
|
264
|
-
- generators/backup/templates/create_backup_tables.rb
|
192
|
+
- generators/backup/backup_generator.rb
|
265
193
|
- generators/backup/templates/backup.rake
|
266
194
|
- generators/backup/templates/backup.rb
|
267
|
-
- generators/backup/
|
195
|
+
- generators/backup/templates/create_backup_tables.rb
|
196
|
+
- generators/backup_update/backup_update_generator.rb
|
197
|
+
- generators/backup_update/templates/migrations/update_backup_tables.rb
|
268
198
|
- setup/backup.rb
|
269
199
|
- setup/backup.sqlite3
|
270
200
|
has_rdoc: true
|
@@ -281,23 +211,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
281
211
|
requirements:
|
282
212
|
- - ">="
|
283
213
|
- !ruby/object:Gem::Version
|
284
|
-
hash: 3
|
285
|
-
segments:
|
286
|
-
- 0
|
287
214
|
version: "0"
|
288
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
289
216
|
none: false
|
290
217
|
requirements:
|
291
218
|
- - ">="
|
292
219
|
- !ruby/object:Gem::Version
|
293
|
-
hash: 3
|
294
|
-
segments:
|
295
|
-
- 0
|
296
220
|
version: "0"
|
297
221
|
requirements: []
|
298
222
|
|
299
223
|
rubyforge_project:
|
300
|
-
rubygems_version: 1.
|
224
|
+
rubygems_version: 1.5.0
|
301
225
|
signing_key:
|
302
226
|
specification_version: 3
|
303
227
|
summary: Backup is a Ruby Gem that simplifies making backups for databases, files and folders.
|