baya 0.1.0 → 0.1.1
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 +7 -7
- data/lib/baya/configuration/file.rb +21 -6
- data/lib/baya.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -35,10 +35,10 @@ The configuration is writen in a single JSON file, and is built around the
|
|
35
35
|
following concepts:
|
36
36
|
|
37
37
|
* All backups are stored in a dedicated folder. All data will be stored in
|
38
|
-
subfolders from that root folder.
|
38
|
+
subfolders from that root folder.
|
39
39
|
* Adapters are the basic storage unit. You can specify a list of adapters that
|
40
|
-
will represent all the data sources you want to backup. For example, all the
|
41
|
-
following are individual adapters you could configure independently:
|
40
|
+
will represent all the data sources you want to backup. For example, all the
|
41
|
+
following are individual adapters you could configure independently:
|
42
42
|
* A Git repository
|
43
43
|
* A single Github account
|
44
44
|
* One remore repository
|
@@ -77,7 +77,7 @@ The Github adapter has three parameters:
|
|
77
77
|
|
78
78
|
* `user` specifies a user account to backup Git repositories from.
|
79
79
|
* `org` is used when you want to backup Git repositories from an origanisation
|
80
|
-
instead of a user account.
|
80
|
+
instead of a user account.
|
81
81
|
* `destination` is the backup destination folder, relative to the global root.
|
82
82
|
|
83
83
|
The `user` and `org` parameters are mutually exclusive, and one of them is
|
@@ -92,7 +92,7 @@ In archive mode, the `rsync` adapter accepts only two parameters. Both are
|
|
92
92
|
mandatory:
|
93
93
|
|
94
94
|
* `source` specifies where to copy from. You can use any rsync compliant
|
95
|
-
syntax to specify remote folders.
|
95
|
+
syntax to specify remote folders.
|
96
96
|
* `destination` is the backup destination, relative to the root folder.
|
97
97
|
|
98
98
|
In archive mode, rsync will be invoked with the `-az` flags to perform the
|
@@ -104,9 +104,9 @@ In backup mode, rsync will be invoked with the following arguments:
|
|
104
104
|
* `-az` to archive all assets using compression over the wire
|
105
105
|
* `--delete` to delete old assets
|
106
106
|
* `--link-dest=previous_backup` to hard link unchanged files instead of
|
107
|
-
copying them. This is in order to save disk space.
|
107
|
+
copying them. This is in order to save disk space.
|
108
108
|
* A timestamp will be added to the destination folder, in order to create a
|
109
|
-
different snapshot for every run
|
109
|
+
different snapshot for every run
|
110
110
|
|
111
111
|
== License
|
112
112
|
|
@@ -2,7 +2,26 @@ module Baya
|
|
2
2
|
module Configuration
|
3
3
|
class File
|
4
4
|
require 'yajl'
|
5
|
-
|
5
|
+
|
6
|
+
class AdapterConfig
|
7
|
+
|
8
|
+
def initialize(hash)
|
9
|
+
@hash = hash
|
10
|
+
end
|
11
|
+
|
12
|
+
def type
|
13
|
+
@hash['type']
|
14
|
+
end
|
15
|
+
|
16
|
+
def mode
|
17
|
+
@hash['mode']
|
18
|
+
end
|
19
|
+
|
20
|
+
def config
|
21
|
+
@hash['config']
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
6
25
|
|
7
26
|
def initialize(file)
|
8
27
|
json = ::File.open(file).read
|
@@ -15,11 +34,7 @@ module Baya
|
|
15
34
|
|
16
35
|
def adapters
|
17
36
|
(@data['adapters'] || []).map do |a|
|
18
|
-
|
19
|
-
adapter.type = a["type"]
|
20
|
-
adapter.mode = a["mode"]
|
21
|
-
adapter.config = a["config"]
|
22
|
-
adapter
|
37
|
+
AdapterConfig.new(a)
|
23
38
|
end
|
24
39
|
end
|
25
40
|
|
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.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 1.8.
|
136
|
+
rubygems_version: 1.8.24
|
137
137
|
signing_key:
|
138
138
|
specification_version: 3
|
139
139
|
summary: Simple backup and archive automation tool
|