simple_backup 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 395191b038aacd9796ee4de7eaceeb967cf5d0af
4
- data.tar.gz: 5e3e87f048a2d0e56cf3736d66fbec5b20feb45c
3
+ metadata.gz: cd3e8ec26688c63d6e75643e4b962556b330c9ef
4
+ data.tar.gz: d721a3e4ee4cea8064440289e527f9633c553a17
5
5
  SHA512:
6
- metadata.gz: 0d808a36f27b75acd742c449e45d53f87b8ccb56f447cc15a1268794eebe5258b73a581a88f8f1df2f62adf9643f76ca3d8d702b1550425bda3c8bd1eacf6d69
7
- data.tar.gz: 5b698daddf93a0356c0c5437b8daf8a51d3df5aca6d5c8b955bd644c98de395ed7d713a98e0b05ff81f6d9ab1d0eba8e4196c2a28576841a5dc721f17748bc7f
6
+ metadata.gz: ba862bc3835154a09912e16c85eab02c7b8defc932dfb755f5d5d6fcaf4f473e1ee87109194520f0a57bbac34188458000ad37aeab9b4d7549845840f8cda6cc
7
+ data.tar.gz: f4eb040ff8315e5b35690ceb309237e8341090185376837e677afa50c92e7b457bbeda0b5f7b87a84142946974c4384f745b32241e5fff18aa1593b7d77aa13e
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Tomasz Maczukin <tomasz@maczukin.pl>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # simple_backup
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/simple_backup.svg)](http://badge.fury.io/rb/simple_backup)
4
+ ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)
5
+
6
+ Backup tool with simple DSL for configuration. Tool is under heavy
7
+ development and its API should be treat as unstable.
8
+
9
+ ## TODO
10
+
11
+ - [ ] Refactorization
12
+ - [ ] Few backend for backup store (file, s3, ftp)
13
+ - [ ] Tests
14
+ - [ ] Docummentation and examples
15
+
16
+ ## License
17
+
18
+ This is free sofware licensed under MIT license. See LICENSE file.
@@ -80,8 +80,8 @@ module SimpleBackup
80
80
 
81
81
  def sources
82
82
  sources = {}
83
- sources[:apps] = @apps.sources
84
- sources[:mysql] = @mysql.sources
83
+ sources[:apps] = @apps.sources if @apps
84
+ sources[:mysql] = @mysql.sources if @mysql
85
85
 
86
86
  sources
87
87
  end
@@ -73,7 +73,7 @@ module SimpleBackup
73
73
  @dbs = dbs
74
74
  @dbs.each do |db, attr|
75
75
  tables = []
76
- @conn.query("SHOW TABLES FROM #{db}").each do |row|
76
+ @conn.query("SHOW TABLES FROM `#{db}`").each do |row|
77
77
  tables << row["Tables_in_#{db}"]
78
78
  end
79
79
  tables = tables - attr[:exclude_tables] if attr[:exclude_tables]
@@ -10,7 +10,7 @@ module SimpleBackup
10
10
  @to = []
11
11
  @cc = []
12
12
  @bcc = []
13
- @hostname = Socket.gethostname
13
+ @hostname = Socket.gethostbyname(Socket.gethostname).first
14
14
  end
15
15
 
16
16
  def subject_prefix(prefix)
@@ -55,7 +55,7 @@ module SimpleBackup
55
55
 
56
56
  @subject_prefix += '[FAILED]' if SimpleBackup.status == :failed
57
57
 
58
- subject = "%s Backup %s for hostname %s" % [@subject_prefix, TIMESTAMP, @hostname]
58
+ subject = "%s Backup %s for %s" % [@subject_prefix, TIMESTAMP, @hostname]
59
59
  Logger::debug "Subject: #{subject}"
60
60
 
61
61
  body = get_body
@@ -52,7 +52,7 @@ module SimpleBackup
52
52
  end
53
53
 
54
54
  def recreate_dir(dir)
55
- Dir.mkdir(dir, 0644)
55
+ Dir.mkdir(dir, 0755)
56
56
 
57
57
  Logger::warning "Recreated non-existing directory '#{dir}'"
58
58
  rescue Errno::EACCES => e
@@ -2,7 +2,7 @@ module SimpleBackup
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE_RELEASE = nil
7
7
 
8
8
  def self.get
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Maczukin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -75,6 +75,8 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - Gemfile
78
+ - LICENSE
79
+ - README.md
78
80
  - Rakefile
79
81
  - backup_example.rb
80
82
  - lib/simple_backup.rb
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  version: '0'
120
122
  requirements: []
121
123
  rubyforge_project:
122
- rubygems_version: 2.2.2
124
+ rubygems_version: 2.4.5
123
125
  signing_key:
124
126
  specification_version: 4
125
127
  summary: Backup tool with simple DSL for configuration