backupsss 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5135178cd9ebc7de71c733c5eddb62657fa350ba
4
- data.tar.gz: f5a0f876890bf8982358a0271f4754a3fbe29166
3
+ metadata.gz: 7d8134a309ca7b0fd67955ee59b704417951b648
4
+ data.tar.gz: 41d054c4ebe76355d2f6d9de6a52c081daf732f3
5
5
  SHA512:
6
- metadata.gz: 4bfbfc835419018ea26a95c502ca497499a38668f563fe46f2664451c085b68bc8a8482da1a1bfa1a6dda3ae48f16a631024c39f6dce5ac9e035bf12d30f96d9
7
- data.tar.gz: 3e24b064ebd5c03a3cde6ad3863390bfd0987a758f80de22b1d6364818ccb8161ee65056bdb07ce035b2003b4a5e545a20b815943ab78f6a0cb5a6bcbfd981dd
6
+ metadata.gz: bb3d651fa5f156ea578f16a708ee73d6edb19e4e19136e6ab2eb27ac9739a490c9f12cf2a7419f8c6adf97be8fe24efb9cb316ebbf4e9f13e44a15400e3eae8c
7
+ data.tar.gz: c738fef618d52401503927e1a14415e6692697f3d321731a46894ba9830d191e1c5b786685dc732bcd55c3928ffff4314d3ad3559e58ade67b97c9f841b21582
data/README.md CHANGED
@@ -25,7 +25,7 @@ Install it like:
25
25
  ```shell
26
26
 
27
27
  $ S3_BUCKET=bucket_name \
28
- S3_BUCKET_KEY=bucket_key \
28
+ S3_BUCKET_PREFIX=bucket_key \
29
29
  BACKUP_SRC_DIR=/path/to/data \
30
30
  BACKUP_DEST_DIR=/backups \
31
31
  BACKUP_FREQ="*/30 * * * *" \
@@ -57,4 +57,3 @@ The gem is available as open source under the terms of the [MIT License][MIT].
57
57
 
58
58
  [rubygems]: https://rubygems.org
59
59
  [MIT]: http://opensource.org/licenses/MIT
60
-
data/backupsss.gemspec CHANGED
@@ -6,10 +6,11 @@ require 'backupsss/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'backupsss'
8
8
  spec.version = Backupsss::VERSION
9
- spec.authors = ['Reppard Walker', 'Jonathan Niesen']
9
+ spec.authors = ['Reppard Walker', 'Jonathan Niesen', 'Jason Antman']
10
10
  spec.email = [
11
11
  'reppard.walker@manheim.com',
12
- 'jonathan.niesen@manheim.com'
12
+ 'jonathan.niesen@manheim.com',
13
+ 'jason@jasonantman.com'
13
14
  ]
14
15
 
15
16
  spec.homepage = 'https://github.com/manheim/backupsss'
data/circle.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  machine:
2
2
  ruby:
3
3
  version:
4
- 2.2.3
4
+ 2.2.5
5
5
  dependencies:
6
6
  pre:
7
7
  - gem install bundler --no-rdoc --no-ri -v 1.11.2
data/lib/backupsss/tar.rb CHANGED
@@ -12,10 +12,21 @@ module Backupsss
12
12
  end
13
13
 
14
14
  def make
15
- if valid_dest? && valid_src?
16
- Open3.capture3("#{tar_command} #{dest} #{src}")
17
- File.open(dest)
15
+ return nil unless valid_dest? && valid_src?
16
+ _, err, status = Open3.capture3("#{tar_command} #{dest} #{src}")
17
+ STDERR.puts "tar command stderr:\n#{err}" unless err.empty?
18
+ check_tar_result(status)
19
+ File.open(dest)
20
+ end
21
+
22
+ def check_tar_result(status)
23
+ if status.exitstatus.nonzero?
24
+ raise "ERROR: #{tar_command} exited #{status.exitstatus}"
25
+ end
26
+ unless File.exist?(dest)
27
+ raise 'ERROR: Tar destination file does not exist'
18
28
  end
29
+ raise 'ERROR: Tar destionation file is 0 bytes.' if File.size(dest).zero?
19
30
  end
20
31
 
21
32
  def valid_dest?
@@ -1,3 +1,3 @@
1
1
  module Backupsss
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/lib/backupsss.rb CHANGED
@@ -66,7 +66,12 @@ module Backupsss
66
66
  def run
67
67
  scheduler = Rufus::Scheduler.new
68
68
  scheduler.cron(config.backup_freq, blocking: true) do
69
- call
69
+ begin
70
+ call
71
+ rescue => exc
72
+ STDERR.puts "ERROR - backup failed: #{exc.message}"
73
+ STDERR.puts exc.backtrace.join("\n\t")
74
+ end
70
75
  end
71
76
  scheduler.join
72
77
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backupsss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reppard Walker
8
8
  - Jonathan Niesen
9
+ - Jason Antman
9
10
  autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2016-05-20 00:00:00.000000000 Z
13
+ date: 2016-11-23 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: bundler
@@ -198,6 +199,7 @@ description: Backup any file or directory as a tar and push the tar to a specifi
198
199
  email:
199
200
  - reppard.walker@manheim.com
200
201
  - jonathan.niesen@manheim.com
202
+ - jason@jasonantman.com
201
203
  executables:
202
204
  - backupsss
203
205
  extensions: []
@@ -246,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
248
  version: '0'
247
249
  requirements: []
248
250
  rubyforge_project:
249
- rubygems_version: 2.2.2
251
+ rubygems_version: 2.5.1
250
252
  signing_key:
251
253
  specification_version: 4
252
254
  summary: Tar a thing and put it in S3