Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents de071be + 12441c9 commit 19f3a453e728dda4edeae828a23ad28d165aa4cf Michael van Rooijen committed Mar 28, 2011
Showing with 5 additions and 6 deletions.
  1. +1 −1 lib/backup/archive.rb
  2. +1 −2 lib/backup/storage/s3.rb
  3. +1 −1 lib/backup/version.rb
  4. +2 −2 spec/archive_spec.rb
@@ -49,7 +49,7 @@ def exclude(path)
def perform!
mkdir(archive_path)
Logger.message("#{ self.class } started packaging and archiving #{ paths.map { |path| "\"#{path}\""}.join(", ") }.")
- run("#{ utility(:tar) } -c #{ paths_to_exclude } #{ paths_to_package } 1> '#{ File.join(archive_path, "#{name}.tar") }' 2> /dev/null")
+ run("#{ utility(:tar) } -c -f '#{ File.join(archive_path, "#{name}.tar") }' #{ paths_to_exclude } #{ paths_to_package } 2> /dev/null")
end
private
@@ -34,14 +34,13 @@ def initialize(&block)
instance_eval(&block) if block_given?
- @path = path.sub(/^\//, '')
@time = TIME
end
##
# This is the remote path to where the backup files will be stored
def remote_path
- File.join(path, TRIGGER, '/')
+ File.join(path, TRIGGER).sub(/^\//, '')
end
##
@@ -13,7 +13,7 @@ class Version
# Defines the minor version
# PATCH:
# Defines the patch version
- MAJOR, MINOR, PATCH = 3, 0, 10
+ MAJOR, MINOR, PATCH = 3, 0, 11
##
# Returns the major version ( big release based off of multiple minor releases )
@@ -64,7 +64,7 @@
context 'when both paths were added and paths that should be excluded were added' do
it 'should render both the syntax for the paths that be included as well as excluded' do
archive.expects(:mkdir).with(File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive'))
- archive.expects(:run).with("tar -c --exclude={'/home/rspecuser/excludefile','/home/rspecuser/excludedir/'} '/home/rspecuser/somefile' '/home/rspecuser/logs/' '/home/rspecuser/dotfiles/' 1> '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' 2> /dev/null")
+ 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")
archive.expects(:utility).with(:tar).returns(:tar)
archive.perform!
end
@@ -77,7 +77,7 @@
end
archive.stubs(:utility).returns(:tar)
- archive.expects(:run).with("tar -c '/path/to/archive' 1> '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' 2> /dev/null")
+ archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' '/path/to/archive' 2> /dev/null")
archive.perform!
end
end

0 comments on commit 19f3a45

Please sign in to comment.