insxsync 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cge_backup.rb +14 -13
- data/lib/insxsync/version.rb +1 -1
- data/lib/sync_point_collection.rb +12 -5
- metadata +2 -2
data/lib/cge_backup.rb
CHANGED
@@ -129,23 +129,24 @@ class CGEBackup < ErrorHandlingIface
|
|
129
129
|
|
130
130
|
# For each dump
|
131
131
|
@dumps.each do |dump|
|
132
|
-
zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION,Zlib::MAX_WBITS, Zlib::DEF_MEM_LEVEL, Zlib::HUFFMAN_ONLY)
|
133
|
-
open dump, 'r' do |dump_file|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
end
|
132
|
+
#zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION,Zlib::MAX_WBITS, Zlib::DEF_MEM_LEVEL, Zlib::HUFFMAN_ONLY)
|
133
|
+
#open dump, 'r' do |dump_file|
|
134
|
+
# begin
|
135
|
+
# open dump + '.deflated', 'w+' do |def_file|
|
136
|
+
# until dump_file.eof?
|
137
|
+
# def_file << zd.deflate(dump_file.read(16384))
|
138
|
+
# end
|
139
|
+
# end
|
140
|
+
# ensure
|
141
|
+
# zd.close
|
142
|
+
# end
|
143
|
+
#end
|
144
144
|
|
145
145
|
|
146
146
|
name = File.basename(dump)
|
147
147
|
# Deflate the contents of the dump and write them to an S3 object
|
148
|
-
bucket.objects["#{prefix}/database/#{name}.deflated"].write(Pathname.new(dump + '.deflated'))
|
148
|
+
#bucket.objects["#{prefix}/database/#{name}.deflated"].write(Pathname.new(dump + '.deflated'))
|
149
|
+
bucket.objects["#{prefix}/database/#{name}"].write(Pathname.new(dump))
|
149
150
|
end
|
150
151
|
end
|
151
152
|
|
data/lib/insxsync/version.rb
CHANGED
@@ -78,16 +78,23 @@ class SyncPointCollection < ErrorHandlingIface
|
|
78
78
|
bucket = AWS::S3.new(:access_key_id => $AWS_ID, :secret_access_key => $AWS_SECRET).buckets[$SYNC_BUCKET]
|
79
79
|
|
80
80
|
bucket.objects.with_prefix(@points[id - 1].epoch_time).each do |obj|
|
81
|
-
next unless obj.key =~ /(.*?)\.
|
81
|
+
next unless obj.key =~ /(.*?)\.sql/
|
82
82
|
suffix = obj.key.scan(/\d*\/(.*)/).flatten[0]
|
83
|
-
filename = File.join(
|
84
|
-
FileUtils.mkdir_p(File.dirname(filename))
|
85
|
-
|
83
|
+
filename = File.join(dir, suffix)
|
86
84
|
File.open(filename, 'w') do |file|
|
87
|
-
data = Zlib::Inflate.inflate(obj.read)
|
88
85
|
file.write(data)
|
89
86
|
end
|
90
87
|
end
|
88
|
+
# next unless obj.key =~ /(.*?)\.deflated/
|
89
|
+
# suffix = obj.key.scan(/\d*\/(.*)/).flatten[0]
|
90
|
+
# filename = File.join(File.dirname(File.join(dir, suffix)), File.basename(suffix, '.deflated'))
|
91
|
+
# FileUtils.mkdir_p(File.dirname(filename))
|
92
|
+
#
|
93
|
+
# File.open(filename, 'w') do |file|
|
94
|
+
# data = Zlib::Inflate.inflate(obj.read)
|
95
|
+
# file.write(data)
|
96
|
+
# end
|
97
|
+
#end
|
91
98
|
end
|
92
99
|
|
93
100
|
# Displays a listing of the available synchronization points, perhaps filtered based on the passed parameters
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: insxsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|