baya 0.1.1 → 0.1.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/README.rdoc +12 -2
- data/lib/baya/adapters/rsync.rb +24 -3
- data/lib/baya/binaries/baya.rb +5 -1
- data/lib/baya.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -9,6 +9,12 @@ At the moment, Baya supports archives from the following:
|
|
9
9
|
* Github accounts
|
10
10
|
* Local and remote machines via rsync
|
11
11
|
|
12
|
+
== Installation
|
13
|
+
|
14
|
+
Baya is available on Rubygems. You can install it by simply running:
|
15
|
+
|
16
|
+
gem install baya
|
17
|
+
|
12
18
|
== Usage
|
13
19
|
|
14
20
|
Baya aims at being simple to use. Just typing
|
@@ -88,8 +94,7 @@ repositories are backed up at the moment.
|
|
88
94
|
|
89
95
|
=== Rsync adapter
|
90
96
|
|
91
|
-
In archive mode, the `rsync` adapter
|
92
|
-
mandatory:
|
97
|
+
In archive mode, the `rsync` adapter requires two mandatory parameters:
|
93
98
|
|
94
99
|
* `source` specifies where to copy from. You can use any rsync compliant
|
95
100
|
syntax to specify remote folders.
|
@@ -108,6 +113,11 @@ In backup mode, rsync will be invoked with the following arguments:
|
|
108
113
|
* A timestamp will be added to the destination folder, in order to create a
|
109
114
|
different snapshot for every run
|
110
115
|
|
116
|
+
The Rsync adapter also accepts the following optional options:
|
117
|
+
|
118
|
+
* `verbose`: If set to something different than `null` or `false`, this option
|
119
|
+
will enable the verbose mode on the `rsync` subprocess.
|
120
|
+
|
111
121
|
== License
|
112
122
|
|
113
123
|
The MIT License
|
data/lib/baya/adapters/rsync.rb
CHANGED
@@ -39,8 +39,19 @@ module Baya
|
|
39
39
|
|
40
40
|
def rsync_archive(source, target)
|
41
41
|
check_folder(target, "destination")
|
42
|
-
|
43
|
-
|
42
|
+
options = "-az"
|
43
|
+
options += 'v' if @config['verbose']
|
44
|
+
Open3.popen3("rsync", options, source, target) do |i, o, e, process|
|
45
|
+
process && process.value
|
46
|
+
|
47
|
+
o.each_line do |l|
|
48
|
+
STDOUT.puts "rsync: #{l}"
|
49
|
+
end
|
50
|
+
e.each_line do |l|
|
51
|
+
STDERR.puts "rsync: #{l}"
|
52
|
+
end
|
53
|
+
|
54
|
+
if process && process.value != 0
|
44
55
|
raise "Non-zero value from `rsync`."
|
45
56
|
end
|
46
57
|
end
|
@@ -56,9 +67,19 @@ module Baya
|
|
56
67
|
target
|
57
68
|
]
|
58
69
|
options << "--link-dest=#{link}" if link
|
70
|
+
options << "-v" if @config['verbose']
|
59
71
|
|
60
72
|
Open3.popen3(*options) do |i, o, e, process|
|
61
|
-
|
73
|
+
process && process.value
|
74
|
+
|
75
|
+
o.each_line do |l|
|
76
|
+
STDOUT.puts "rsync: #{l}"
|
77
|
+
end
|
78
|
+
e.each_line do |l|
|
79
|
+
STDERR.puts "rsync: #{l}"
|
80
|
+
end
|
81
|
+
|
82
|
+
if process && process.value != 0
|
62
83
|
raise "Non-zero value from `rsync`."
|
63
84
|
end
|
64
85
|
end
|
data/lib/baya/binaries/baya.rb
CHANGED
data/lib/baya.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: git
|