lib/backup/jar.rb in encbs-0.1.2 vs lib/backup/jar.rb in encbs-0.1.3
- old
+ new
@@ -17,17 +17,17 @@
@local_files = hash_local_files
else
@local_files = {}
current_files = hash_local_files
- last_timestamp = Jar.jar_versions(@root_path, jar_hash, true).last
+ last_timestamp = Jar.jar_versions(@file_item, @root_path, jar_hash, true).last
if last_timestamp.nil?
puts_fail "First you must create a full backup for #{@local_path.dark_green}"
end
- last_index = Jar.fetch_index_for(@root_path, jar_hash, last_timestamp)
+ last_index = Jar.fetch_index_for(@file_item, @root_path, jar_hash, last_timestamp)
current_files.keys.each do |file|
@local_files[file] = current_files[file]
#TODO: Cut to a new method {
@@ -56,10 +56,11 @@
@file_item.create_file_once(
"#{meta_jar_path}/#{@timestamp}.yml",
@local_files.to_yaml
)
+ @local_files.select! {|k, v| v[:timestamp] == @timestamp}
if @file_item.is_a? Backup::FileItem::Cloud
pbar = ProgressBar.new(
"Uploading",
@local_files.keys.count
)
@@ -82,10 +83,10 @@
@file_item.create_file_once(
"#{jar_data_path}/#{@file_item.file_hash file}",
data
)
-
+
pbar.inc
end
end
pbar.finish