backupsss 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/backupsss.gemspec +1 -1
- data/exe/backupsss +1 -1
- data/lib/backupsss/configuration.rb +1 -1
- data/lib/backupsss/version.rb +1 -1
- data/lib/backupsss.rb +29 -12
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e188c88c729cebff877b177c50f6b87e9a570bbb
|
4
|
+
data.tar.gz: 853c193df4f897313ef3ef77a13ec00ae3a15616
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af5e3ff5f9c5e4269257294da0229d25f2a7d9f7bbe9066d6be43e87e281982583f3464d079116b8e8b08f33ef61ff3de7249521495bd4a46255c9629b751aa0
|
7
|
+
data.tar.gz: 22aff21ccfe7f0302384ccaa6f459bf2448ab9f8453e730a5a6f3008c988d58d1b3528d2a125a6385911836fc58c8200a6862629b65e8778f54d6efe41bb3510
|
data/backupsss.gemspec
CHANGED
@@ -42,5 +42,5 @@ Gem::Specification.new do |spec|
|
|
42
42
|
|
43
43
|
spec.add_runtime_dependency 'aws-sdk', '~> 2.7.0'
|
44
44
|
spec.add_runtime_dependency 'parallel', '~> 1.10.0'
|
45
|
-
spec.add_runtime_dependency 'rufus-scheduler', '
|
45
|
+
spec.add_runtime_dependency 'rufus-scheduler', '3.4.0'
|
46
46
|
end
|
data/exe/backupsss
CHANGED
data/lib/backupsss/version.rb
CHANGED
data/lib/backupsss.rb
CHANGED
@@ -10,11 +10,20 @@ require 'backupsss/configuration'
|
|
10
10
|
|
11
11
|
# A utility for backing things up to S3.
|
12
12
|
module Backupsss
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
# A Class for running this backup utility
|
14
|
+
class Runner
|
15
|
+
attr_accessor :config
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@config = Backupsss::Configuration.new
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
config.backup_freq ? run_scheduled : run_oneshot
|
16
23
|
end
|
17
24
|
|
25
|
+
private
|
26
|
+
|
18
27
|
def call
|
19
28
|
push_backup(*prep_for_backup)
|
20
29
|
cleanup_local
|
@@ -63,17 +72,25 @@ module Backupsss
|
|
63
72
|
remote_janitor.rm_garbage(remote_janitor.sift_trash)
|
64
73
|
end
|
65
74
|
|
66
|
-
def
|
75
|
+
def run_scheduled
|
76
|
+
$stdout.puts "Schedule provided, running with #{config.backup_freq}"
|
77
|
+
|
67
78
|
scheduler = Rufus::Scheduler.new
|
68
|
-
scheduler.cron(config.backup_freq, blocking: true)
|
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
|
75
|
-
end
|
79
|
+
scheduler.cron(config.backup_freq, blocking: true) { make_call }
|
76
80
|
scheduler.join
|
77
81
|
end
|
82
|
+
|
83
|
+
def run_oneshot
|
84
|
+
$stdout.puts 'No Schedule provided, running one time task'
|
85
|
+
|
86
|
+
make_call
|
87
|
+
end
|
88
|
+
|
89
|
+
def make_call
|
90
|
+
call
|
91
|
+
rescue => exc
|
92
|
+
$stderr.puts "ERROR - backup failed: #{exc.message}"
|
93
|
+
$stderr.puts exc.backtrace.join("\n\t")
|
94
|
+
end
|
78
95
|
end
|
79
96
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backupsss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reppard Walker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -198,16 +198,16 @@ dependencies:
|
|
198
198
|
name: rufus-scheduler
|
199
199
|
requirement: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
|
-
- -
|
201
|
+
- - '='
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: 3.
|
203
|
+
version: 3.4.0
|
204
204
|
type: :runtime
|
205
205
|
prerelease: false
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- -
|
208
|
+
- - '='
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: 3.
|
210
|
+
version: 3.4.0
|
211
211
|
description: Backup any file or directory as a tar and push the tar to a specificed
|
212
212
|
S3 bucket.
|
213
213
|
email:
|