backup 3.0.10 → 3.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/backup/archive.rb +1 -1
- data/lib/backup/storage/s3.rb +1 -2
- data/lib/backup/version.rb +1 -1
- data/spec/archive_spec.rb +2 -2
- metadata +2 -2
data/lib/backup/archive.rb
CHANGED
@@ -49,7 +49,7 @@ module Backup
|
|
49
49
|
def perform!
|
50
50
|
mkdir(archive_path)
|
51
51
|
Logger.message("#{ self.class } started packaging and archiving #{ paths.map { |path| "\"#{path}\""}.join(", ") }.")
|
52
|
-
run("#{ utility(:tar) } -c
|
52
|
+
run("#{ utility(:tar) } -c -f '#{ File.join(archive_path, "#{name}.tar") }' #{ paths_to_exclude } #{ paths_to_package } 2> /dev/null")
|
53
53
|
end
|
54
54
|
|
55
55
|
private
|
data/lib/backup/storage/s3.rb
CHANGED
@@ -34,14 +34,13 @@ module Backup
|
|
34
34
|
|
35
35
|
instance_eval(&block) if block_given?
|
36
36
|
|
37
|
-
@path = path.sub(/^\//, '')
|
38
37
|
@time = TIME
|
39
38
|
end
|
40
39
|
|
41
40
|
##
|
42
41
|
# This is the remote path to where the backup files will be stored
|
43
42
|
def remote_path
|
44
|
-
File.join(path, TRIGGER
|
43
|
+
File.join(path, TRIGGER).sub(/^\//, '')
|
45
44
|
end
|
46
45
|
|
47
46
|
##
|
data/lib/backup/version.rb
CHANGED
data/spec/archive_spec.rb
CHANGED
@@ -64,7 +64,7 @@ describe Backup::Archive do
|
|
64
64
|
context 'when both paths were added and paths that should be excluded were added' do
|
65
65
|
it 'should render both the syntax for the paths that be included as well as excluded' do
|
66
66
|
archive.expects(:mkdir).with(File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive'))
|
67
|
-
archive.expects(:run).with("tar -c --exclude={'/home/rspecuser/excludefile','/home/rspecuser/excludedir/'} '/home/rspecuser/somefile' '/home/rspecuser/logs/' '/home/rspecuser/dotfiles/'
|
67
|
+
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' --exclude={'/home/rspecuser/excludefile','/home/rspecuser/excludedir/'} '/home/rspecuser/somefile' '/home/rspecuser/logs/' '/home/rspecuser/dotfiles/' 2> /dev/null")
|
68
68
|
archive.expects(:utility).with(:tar).returns(:tar)
|
69
69
|
archive.perform!
|
70
70
|
end
|
@@ -77,7 +77,7 @@ describe Backup::Archive do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
archive.stubs(:utility).returns(:tar)
|
80
|
-
archive.expects(:run).with("tar -c
|
80
|
+
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' '/path/to/archive' 2> /dev/null")
|
81
81
|
archive.perform!
|
82
82
|
end
|
83
83
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.0.
|
5
|
+
version: 3.0.11
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael van Rooijen
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-28 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|