s3backup 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.rdoc +21 -16
- data/lib/s3backup/manager.rb +4 -3
- data/lib/s3backup/s3wrapper.rb +1 -2
- data/lib/s3backup.rb +1 -1
- data/script/console +0 -0
- data/script/destroy +0 -0
- data/script/generate +0 -0
- metadata +3 -3
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -12,21 +12,25 @@ It can be Cryptnize upload files if password and salt are configured.
|
|
12
12
|
|
13
13
|
== SYNOPSIS:
|
14
14
|
|
15
|
-
To use remotebackup,you should prepare backup configuretion by yaml such below.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
- "absolute path to directory for backup/restore"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
15
|
+
To use remotebackup,you should prepare backup configuretion file by yaml such below.
|
16
|
+
bucket: "bucket name"
|
17
|
+
directories:
|
18
|
+
- "absolute path to directory for backup/restore"
|
19
|
+
- "absolute path to directory for backup/restore"
|
20
|
+
access_key_id: 'Amazon access_key_id'
|
21
|
+
secret_access_key: 'Amazon secret_access_key'
|
22
|
+
password: 'password for aes. (optional)'
|
23
|
+
salt: 'HexString(16 length) (must when password is specified) '
|
24
|
+
proxy_host: proxy host address if you use proxy.
|
25
|
+
proxy_port: proxy port if you use proxy.
|
26
|
+
proxy_user: login name for proxy server if you use proxy.
|
27
|
+
proxy_password: login password for proxy server if you use proxy.
|
28
|
+
*If directories isn't specified when restore, it restores all directories in bucket.
|
29
|
+
|
30
|
+
== COMMAND:
|
31
|
+
|
32
|
+
=== backup
|
33
|
+
|
30
34
|
s3backup [-f configuration file] [-v verbose message] [-l path for log] [-h help]
|
31
35
|
|
32
36
|
configuration file path to file written above contents. default is ./backup.yml
|
@@ -34,7 +38,8 @@ for backup:
|
|
34
38
|
path for log defaut starndard output.
|
35
39
|
help help message
|
36
40
|
|
37
|
-
|
41
|
+
=== restore
|
42
|
+
|
38
43
|
s3backup -r [-f configuration file] [-v verbose message] [-l path for log] [-o output dir] [-h help]
|
39
44
|
|
40
45
|
configuration file path to file written above contents. default is ./backup.yml
|
data/lib/s3backup/manager.rb
CHANGED
@@ -3,6 +3,7 @@ require 'tempfile'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 's3backup/s3log'
|
5
5
|
require 's3backup/tree_info'
|
6
|
+
require 's3backup/crypt'
|
6
7
|
module S3backup
|
7
8
|
class Manager
|
8
9
|
DEFAULT_BUF_READ_SIZE=1024*1024*128
|
@@ -38,8 +39,8 @@ module S3backup
|
|
38
39
|
sub_dir.push(file) if File.directory?(dir+"/"+file)
|
39
40
|
end
|
40
41
|
exclude = ""
|
41
|
-
exclude = exclude + " --exclude=" + sub_dir.join(" --exclude=") if sub_dir.length != 0
|
42
|
-
cmd = "(cd #{File.dirname(dir)};tar -czvf #{path} #{exclude} #{File.basename(dir)} > /dev/null 2>&1)"
|
42
|
+
exclude = exclude + " --exclude=" + sub_dir.map{|d| d.gsub(' ','\ ')}.join(" --exclude=") if sub_dir.length != 0
|
43
|
+
cmd = "(cd #{File.dirname(dir).gsub(' ','\ ')};tar -czvf #{path.gsub(' ','\ ')} #{exclude} #{File.basename(dir).gsub(' ','\ ')} > /dev/null 2>&1)"
|
43
44
|
S3log.debug(cmd)
|
44
45
|
system(cmd)
|
45
46
|
unless $?.success?
|
@@ -47,7 +48,7 @@ module S3backup
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
def from_tgz(path,dir)
|
50
|
-
cmd = "tar -xzvf #{path} -C #{dir} > /dev/null 2>&1"
|
51
|
+
cmd = "tar -xzvf #{path.gsub(' ','\ ')} -C #{dir.gsub(' ','\ ')} > /dev/null 2>&1"
|
51
52
|
S3log.debug(cmd)
|
52
53
|
system(cmd)
|
53
54
|
unless $?.success?
|
data/lib/s3backup/s3wrapper.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'cgi'
|
2
2
|
require 'aws/s3'
|
3
|
-
require 's3backup/crypt'
|
4
3
|
module S3backup
|
5
4
|
class S3Wrapper
|
6
5
|
attr_reader :bucket
|
@@ -22,7 +21,7 @@ module S3backup
|
|
22
21
|
if create_flg
|
23
22
|
begin
|
24
23
|
@bucket = AWS::S3::Bucket.find(@bucket_name)
|
25
|
-
rescue
|
24
|
+
rescue
|
26
25
|
@bucket = create_bucket
|
27
26
|
end
|
28
27
|
else
|
data/lib/s3backup.rb
CHANGED
data/script/console
CHANGED
File without changes
|
data/script/destroy
CHANGED
File without changes
|
data/script/generate
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi Morita
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-15 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements: []
|
94
94
|
|
95
95
|
rubyforge_project: s3backup
|
96
|
-
rubygems_version: 1.3.
|
96
|
+
rubygems_version: 1.3.5
|
97
97
|
signing_key:
|
98
98
|
specification_version: 3
|
99
99
|
summary: S3Backup is a backup tool to local directory to Amazon S3.
|