backup_demon 0.0.1 → 0.0.2
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.
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/Rakefile +2 -0
- data/backup_demon.gemspec +1 -1
- data/lib/backup_demon/daemon.rb +1 -3
- data/lib/backup_demon/device.rb +2 -2
- data/lib/backup_demon/version.rb +1 -1
- data/lib/backup_demon.rb +1 -4
- metadata +18 -5
- checksums.yaml +0 -15
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/*
|
data/Gemfile.lock
CHANGED
data/README.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Backup-Demon
|
2
|
+
|
3
|
+
Basically, a simple daemon that watches for a device to come around; then it mounts it, rsyncs it, and unmounts it.
|
4
|
+
|
5
|
+
To make things interesting, it won't keep backing up to the same drive, expecting you to swap the drive every time you want a new backup.
|
6
|
+
|
7
|
+
## Installing
|
8
|
+
|
9
|
+
gem install backup_demon
|
10
|
+
|
11
|
+
That will give you the command `backup_demon` and get you rolling.
|
data/Rakefile
ADDED
data/backup_demon.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = "backup_demon"
|
6
6
|
s.version = BackupDemon::Version
|
7
7
|
s.summary = "BackupDemon backs up to external drives"
|
8
|
-
s.homepage = "https://github.com/ryanfaerman"
|
8
|
+
s.homepage = "https://github.com/ryanfaerman/backup_demon"
|
9
9
|
s.email = ["ry@nwitty.com"]
|
10
10
|
s.authors = ["Ryan Faerman"]
|
11
11
|
|
data/lib/backup_demon/daemon.rb
CHANGED
@@ -10,8 +10,6 @@ module BackupDemon
|
|
10
10
|
interval = Float(interval)
|
11
11
|
procline 'waiting for drive...'
|
12
12
|
|
13
|
-
# puts "#{@drive.exists?} && #{@drive.different?} (#{@drive.exists? && @drive.different?})"
|
14
|
-
# puts "#{@drive.previous.inspect} != #{@drive.current.inspect} || #{@drive.current.nil?}"
|
15
13
|
if @drive.exists? && @drive.different?
|
16
14
|
procline 'Found Drive'
|
17
15
|
if @drive.mount(@mount_point)
|
@@ -32,7 +30,7 @@ module BackupDemon
|
|
32
30
|
end
|
33
31
|
|
34
32
|
def procline(string)
|
35
|
-
$0 = "
|
33
|
+
$0 = "backup_demon: #{string}"
|
36
34
|
end
|
37
35
|
|
38
36
|
def pid
|
data/lib/backup_demon/device.rb
CHANGED
@@ -34,7 +34,7 @@ module BackupDemon
|
|
34
34
|
def mount(mount_point)
|
35
35
|
@mount_point = mount_point
|
36
36
|
FileUtils.mkdir_p(@mount_point) unless File.exists?(@mount_point)
|
37
|
-
|
37
|
+
`mount #{@device} #{@mount_point}`
|
38
38
|
|
39
39
|
if mounted?
|
40
40
|
@previous = File.stat(@device)
|
@@ -50,7 +50,7 @@ module BackupDemon
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def unmount
|
53
|
-
|
53
|
+
`umount #{@device}`
|
54
54
|
end
|
55
55
|
|
56
56
|
def unmounted?
|
data/lib/backup_demon/version.rb
CHANGED
data/lib/backup_demon.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup_demon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Ryan Faerman
|
@@ -13,6 +14,7 @@ dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: thor
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -33,8 +36,11 @@ executables:
|
|
33
36
|
extensions: []
|
34
37
|
extra_rdoc_files: []
|
35
38
|
files:
|
39
|
+
- .gitignore
|
36
40
|
- Gemfile
|
37
41
|
- Gemfile.lock
|
42
|
+
- README.md
|
43
|
+
- Rakefile
|
38
44
|
- backup_demon.gemspec
|
39
45
|
- bin/backup_demon
|
40
46
|
- lib/backup_demon.rb
|
@@ -45,27 +51,34 @@ files:
|
|
45
51
|
- lib/backup_demon/device.rb
|
46
52
|
- lib/backup_demon/sync.rb
|
47
53
|
- lib/backup_demon/version.rb
|
48
|
-
homepage: https://github.com/ryanfaerman
|
54
|
+
homepage: https://github.com/ryanfaerman/backup_demon
|
49
55
|
licenses: []
|
50
|
-
metadata: {}
|
51
56
|
post_install_message:
|
52
57
|
rdoc_options: []
|
53
58
|
require_paths:
|
54
59
|
- lib
|
55
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
56
62
|
requirements:
|
57
63
|
- - ! '>='
|
58
64
|
- !ruby/object:Gem::Version
|
59
65
|
version: '0'
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
hash: -2489128216511426742
|
60
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
61
71
|
requirements:
|
62
72
|
- - ! '>='
|
63
73
|
- !ruby/object:Gem::Version
|
64
74
|
version: '0'
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
hash: -2489128216511426742
|
65
78
|
requirements: []
|
66
79
|
rubyforge_project:
|
67
|
-
rubygems_version:
|
80
|
+
rubygems_version: 1.8.24
|
68
81
|
signing_key:
|
69
|
-
specification_version:
|
82
|
+
specification_version: 3
|
70
83
|
summary: BackupDemon backs up to external drives
|
71
84
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
Y2M0Nzk4YzkwOGI1OWVkZmVjNzFlMmQ1NDMwOGY3YTJlMmFkZTE4OA==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZDViNGE3NzcyN2MwMTE1MTcwZTgxYzU4MzFiZjA4NTVmODg5YmI1NA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
Y2E0YTljNGFiYzMwZmU3MzNkYTU3OWQ1YmE5YWE2ZmM5MmVjMTYxZGUwMTlh
|
10
|
-
OWU3ZTIzOTBhNTBkYTk1Yzk2N2VmZjYzZDEwODU5NWU4ZGZjNThhZWE2ZDY1
|
11
|
-
ZDU1NDcxMDFhOGM4YmZiN2RkOGFlZDE2Njk5NDEzOTUyYmRhYWU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZGFlNTgzNzkzOGRlYjAxMjQ5NzAxMDdlZDdmMjRhYmMzMGQ4YWY1NjJiMmFi
|
14
|
-
YzdmNWFjODgxMjM5MjAwMWJiMTc2ZDRlYjdhMDk2ZjE2MGUwMjViNWNkZDdl
|
15
|
-
NWEyYzBhOGFlODU5ZGY2YzIxN2FiNTg2MGVkMjZmNWE2NTFkNWQ=
|