lib/s3backup/manager.rb in s3backup-0.8.3 vs lib/s3backup/manager.rb in s3backup-0.8.4
- old
+ new
@@ -131,15 +131,15 @@
i+=1
end
end
end
def get_directory(dir,out_dir)
- file_name = @temporary + "/"+ CGI.escape(dir)
- get_chain(dir,file_name + ".tgz")
+ file_name = @temporary + "/rs_#{Process.pid}.tgz"
+ get_chain(dir,file_name)
#tgzのファイルをcur_dirに展開
- from_tgz(file_name + ".tgz",out_dir)
- #File.unlink(file_name)
+ from_tgz(file_name,out_dir)
+ File.unlink(file_name)
end
def get_directories(dirs,prefix,output_dir)
prefix_len = prefix.length
dirs.each do |dir|
parent = File.dirname(dir)
@@ -148,10 +148,10 @@
cur_dir = output_dir + relative_path
get_directory(dir,cur_dir)
end
end
def store_directory(dir)
- tmp_file = @temporary + "/bk_" + CGI.escape(dir)
+ tmp_file = @temporary + "/bk_#{Process.pid}"
#tgzのファイルをtmp.pathに作成
to_tgz(tmp_file,dir)
#S3にディレクトリの絶対パスをキーにして、圧縮したデータをストア
i=1
key = nil