cloudsync 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/cloudsync.gemspec +2 -2
- data/lib/cloudsync/backend/base.rb +1 -1
- data/lib/cloudsync/backend/cloudfiles.rb +2 -7
- data/lib/cloudsync/backend/s3.rb +0 -2
- data/lib/cloudsync/sync_manager.rb +9 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.0
|
data/cloudsync.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cloudsync}
|
8
|
-
s.version = "2.
|
8
|
+
s.version = "2.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Cory Forsyth"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-25}
|
13
13
|
s.default_executable = %q{cloudsync}
|
14
14
|
s.description = %q{Sync files between various clouds or sftp servers. Available backends are S3, CloudFiles, and SFTP servers. Can sync, mirror, and prune.}
|
15
15
|
s.email = %q{cory.forsyth@gmail.com}
|
@@ -73,13 +73,13 @@ module Cloudsync
|
|
73
73
|
if delete_container_if_empty
|
74
74
|
container.refresh
|
75
75
|
if container.empty?
|
76
|
-
$LOGGER.
|
76
|
+
$LOGGER.info("Deleting empty container '#{container.name}'")
|
77
77
|
@store.delete_container(container.name)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
81
|
rescue NoSuchContainerException, NoSuchObjectException => e
|
82
|
-
$LOGGER.error("Failed to delete file #{file}")
|
82
|
+
$LOGGER.error("Failed to delete file #{file}, container #{container.name}")
|
83
83
|
end
|
84
84
|
|
85
85
|
def get_file_from_store(file)
|
@@ -113,10 +113,6 @@ module Cloudsync
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
# cf = Cloudsync::Backend::CloudFiles.new( YAML::load_file("cloudsync.yml")[:cloudfiles]); $LOGGER = Logger.new(STDOUT); count = 0; cf.files_to_sync {|p,h| count += 1 }; puts count
|
117
|
-
# cf = Cloudsync::Backend::CloudFiles.new( YAML::load_file("cloudsync.yml")[:cloudfiles]); $LOGGER = Logger.new(STDOUT); count = 0; paths = []; cf.files_to_sync("mpsounds-adobe.max.trivia") {|f| count += 1; paths << f.path}; puts count
|
118
|
-
|
119
|
-
|
120
116
|
# prefix_path must not include the container name at the beginning of the string
|
121
117
|
def objects_from_container(container, prefix_path="", &block)
|
122
118
|
$LOGGER.debug("Getting files from #{container.name} (prefix: #{prefix_path})")
|
@@ -131,7 +127,6 @@ module Cloudsync
|
|
131
127
|
objects_details = container.objects_detail(params)
|
132
128
|
|
133
129
|
$LOGGER.debug("OFC #{container.name} (#{prefix_path}) got #{objects_details.size}. #{objects_details.class}")
|
134
|
-
$LOGGER.debug("-"*50)
|
135
130
|
|
136
131
|
break if objects_details.empty?
|
137
132
|
|
data/lib/cloudsync/backend/s3.rb
CHANGED
@@ -111,12 +111,10 @@ module Cloudsync
|
|
111
111
|
params['prefix'] = prefix if !prefix.nil?
|
112
112
|
|
113
113
|
loop do
|
114
|
-
$LOGGER.debug(params.inspect)
|
115
114
|
keys = bucket.keys(params)
|
116
115
|
break if keys.empty?
|
117
116
|
|
118
117
|
keys.each do |key|
|
119
|
-
$LOGGER.debug(key.name)
|
120
118
|
yield key
|
121
119
|
end
|
122
120
|
|
@@ -92,6 +92,15 @@ module Cloudsync
|
|
92
92
|
$LOGGER.info("[SM]: Prune: Completed #{index} files (skipped: #{file_stats[:skipped].size}, removed: #{file_stats[:removed].size}).")
|
93
93
|
end
|
94
94
|
|
95
|
+
if index % Cloudsync::Backend::Base::OBJECT_LIMIT == 0
|
96
|
+
$LOGGER.debug("GC starting")
|
97
|
+
GC.start
|
98
|
+
|
99
|
+
memory_usage = `ps -o rss= -p #{$$}`.to_i
|
100
|
+
ocount = 0; ObjectSpace.each_object {|o| ocount += 1}
|
101
|
+
$LOGGER.debug "memory: #{memory_usage}, objects: #{ocount}"
|
102
|
+
end
|
103
|
+
|
95
104
|
index += 1
|
96
105
|
end
|
97
106
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 2.
|
10
|
+
version: 2.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cory Forsyth
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-25 00:00:00 -04:00
|
19
19
|
default_executable: cloudsync
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|