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 +4 -4
- data/README.md +1 -2
- data/backupsss.gemspec +3 -2
- data/circle.yml +1 -1
- data/lib/backupsss/tar.rb +14 -3
- data/lib/backupsss/version.rb +1 -1
- data/lib/backupsss.rb +6 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d8134a309ca7b0fd67955ee59b704417951b648
|
4
|
+
data.tar.gz: 41d054c4ebe76355d2f6d9de6a52c081daf732f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
data/lib/backupsss/tar.rb
CHANGED
@@ -12,10 +12,21 @@ module Backupsss
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def make
|
15
|
-
|
16
|
-
|
17
|
-
|
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?
|
data/lib/backupsss/version.rb
CHANGED
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
|
-
|
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.
|
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-
|
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.
|
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
|