s3cp 1.1.40 → 1.1.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0290c1eaaabbc90626e8a996868953051a421e66
4
- data.tar.gz: c122054dbd6b8dcaa3ae610027c84667d57c06b3
3
+ metadata.gz: 547c783a85db260be45e507a599714debb2076d1
4
+ data.tar.gz: 1e1b8831f9d793eb7a456501bea6a67a1f786281
5
5
  SHA512:
6
- metadata.gz: fe1d294a160d801372d7fa81590a037627033aaa2264644436598c258dd030e7abab6f2beca427e44f6588fa6288353a75b02071220e83af8aa3ac88951838b4
7
- data.tar.gz: 4b98037c37e4d3a4e6fb4357204d20918cea037aac329c8dbcb3057c270c3618a17b94397e5d8f34589bf12e0f51a55f75b58c8a1b95b782f342f94b0d365ffb
6
+ metadata.gz: 268f7df890f20eaef4c8dccecf66b3615179d97261f3c1a7c3031ec64e9bdac3e49a14d4b21b69993c28f9bfb85f71d555116a5421aa059663b0fa929535d7b6
7
+ data.tar.gz: 403dd0e3399e0fd06676fe1130ffd3d1f4e91b51b00381ed664dcc066ff03334fd0c445242bdcb921eaacf99e2be62ac3b517cc1bfe0e8f3f8903011465bea23
@@ -1,3 +1,6 @@
1
+ === 1.1.41 (2017-11-30)
2
+
3
+ * Fixed: s3rm now incrementally deletes objects (per new --batch size parameter; defaults to 10,000)
1
4
 
2
5
  === 1.1.40 (2015-12-21)
3
6
 
@@ -25,6 +25,7 @@ options[:exclude_regex] = nil
25
25
  options[:test] = false
26
26
  options[:silent] = false
27
27
  options[:fail_if_not_exist] = false
28
+ options[:batch_size] = 10000
28
29
 
29
30
  op = OptionParser.new do |opts|
30
31
  opts.banner = "s3rm [path]"
@@ -54,6 +55,10 @@ op = OptionParser.new do |opts|
54
55
  options[:silent] = true
55
56
  end
56
57
 
58
+ opts.on("--batch", "Delete batch size.") do |batch|
59
+ options[:batch_size] = batch.to_i
60
+ end
61
+
57
62
  opts.on("--verbose", "Verbose mode") do
58
63
  options[:verbose] = true
59
64
  end
@@ -123,6 +128,14 @@ S3CP.standard_exception_handling(options) do
123
128
  matching_keys << entry.key
124
129
  puts key unless options[:silent] || options[:verbose]
125
130
  end
131
+
132
+ if matching_keys.size > options[:batch_size]
133
+ if options[:verbose]
134
+ puts "Deleting batch..."
135
+ end
136
+ @s3.buckets[@bucket].objects.delete(matching_keys) unless options[:test]
137
+ matching_keys = []
138
+ end
126
139
  end
127
140
 
128
141
  if options[:fail_if_not_exist] && matching_keys.length == 0
@@ -16,5 +16,5 @@
16
16
  # the License.
17
17
 
18
18
  module S3CP
19
- VERSION = "1.1.40"
19
+ VERSION = "1.1.41"
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3cp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.40
4
+ version: 1.1.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Boisvert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-21 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: extensions
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: 1.3.6
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.0.14
194
+ rubygems_version: 2.0.14.1
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: Amazon S3 tools to, e.g., list, copy, delete S3 files