backup-ssh 4.1.10 → 4.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -6
  3. data/lib/backup.rb +3 -0
  4. data/lib/backup/config/dsl.rb +2 -2
  5. data/lib/backup/database/mongodb.rb +2 -1
  6. data/lib/backup/database/mysql.rb +2 -2
  7. data/lib/backup/database/postgresql.rb +1 -1
  8. data/lib/backup/model.rb +26 -1
  9. data/lib/backup/notifier/base.rb +30 -0
  10. data/lib/backup/notifier/campfire.rb +1 -7
  11. data/lib/backup/notifier/command.rb +102 -0
  12. data/lib/backup/notifier/datadog.rb +11 -20
  13. data/lib/backup/notifier/flowdock.rb +6 -5
  14. data/lib/backup/notifier/hipchat.rb +33 -8
  15. data/lib/backup/notifier/http_post.rb +2 -7
  16. data/lib/backup/notifier/mail.rb +26 -15
  17. data/lib/backup/notifier/nagios.rb +3 -8
  18. data/lib/backup/notifier/prowl.rb +8 -9
  19. data/lib/backup/notifier/pushover.rb +1 -7
  20. data/lib/backup/notifier/ses.rb +19 -8
  21. data/lib/backup/notifier/slack.rb +4 -10
  22. data/lib/backup/notifier/twitter.rb +1 -7
  23. data/lib/backup/notifier/zabbix.rb +1 -6
  24. data/lib/backup/package.rb +4 -0
  25. data/lib/backup/packager.rb +8 -2
  26. data/lib/backup/storage/base.rb +15 -3
  27. data/lib/backup/storage/cycler.rb +24 -14
  28. data/lib/backup/storage/dropbox.rb +0 -24
  29. data/lib/backup/storage/ftp.rb +15 -1
  30. data/lib/backup/storage/qiniu.rb +65 -0
  31. data/lib/backup/storage/s3.rb +3 -2
  32. data/lib/backup/syncer/rsync/base.rb +7 -1
  33. data/lib/backup/version.rb +1 -1
  34. data/templates/cli/databases/mongodb +1 -1
  35. data/templates/cli/notifiers/command +32 -0
  36. data/templates/cli/notifiers/hipchat +1 -0
  37. data/templates/cli/notifiers/mail +3 -0
  38. data/templates/cli/storages/dropbox +1 -0
  39. data/templates/cli/storages/ftp +1 -0
  40. data/templates/cli/storages/local +1 -0
  41. data/templates/cli/storages/qiniu +12 -0
  42. data/templates/cli/storages/s3 +2 -0
  43. data/templates/cli/storages/scp +1 -0
  44. data/templates/cli/storages/sftp +1 -0
  45. metadata +79 -46
  46. data/LICENSE.md +0 -24
  47. data/lib/backup/storage/ninefold.rb +0 -74
  48. data/templates/cli/storages/ninefold +0 -9
data/LICENSE.md DELETED
@@ -1,24 +0,0 @@
1
-
2
- Copyright (c) 2009-2013 Michael van Rooijen ( [@meskyanichi](http://twitter.com/#!/meskyanichi) )
3
- =================================================================================================
4
-
5
- The "Backup" RubyGem is released under the **MIT LICENSE**
6
- ----------------------------------------------------------
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
@@ -1,74 +0,0 @@
1
- # encoding: utf-8
2
- require 'fog'
3
-
4
- module Backup
5
- module Storage
6
- class Ninefold < Base
7
- include Storage::Cycler
8
- class Error < Backup::Error; end
9
-
10
- ##
11
- # Ninefold Credentials
12
- attr_accessor :storage_token, :storage_secret
13
-
14
- def initialize(model, storage_id = nil)
15
- super
16
-
17
- @path ||= 'backups'
18
- path.sub!(/^\//, '')
19
- end
20
-
21
- private
22
-
23
- def connection
24
- @connection ||= Fog::Storage.new(
25
- :provider => 'Ninefold',
26
- :ninefold_storage_token => storage_token,
27
- :ninefold_storage_secret => storage_secret
28
- )
29
- end
30
-
31
- def transfer!
32
- directory = directory_for(remote_path, true)
33
- package.filenames.each do |filename|
34
- src = File.join(Config.tmp_path, filename)
35
- dest = File.join(remote_path, filename)
36
- Logger.info "Storing '#{ dest }'..."
37
- File.open(src, 'r') do |file|
38
- directory.files.create(:key => filename, :body => file)
39
- end
40
- end
41
- end
42
-
43
- ##
44
- # Queries the connection for the directory for the given +remote_path+
45
- # Returns nil if not found, or creates the directory if +create+ is true.
46
- def directory_for(remote_path, create = false)
47
- directory = connection.directories.get(remote_path)
48
- if directory.nil? && create
49
- directory = connection.directories.create(:key => remote_path)
50
- end
51
- directory
52
- end
53
-
54
- # Called by the Cycler.
55
- # Any error raised will be logged as a warning.
56
- def remove!(package)
57
- Logger.info "Removing backup package dated #{ package.time }..."
58
-
59
- remote_path = remote_path_for(package)
60
- directory = directory_for(remote_path)
61
-
62
- raise Error, "Directory at '#{ remote_path }' not found" unless directory
63
-
64
- package.filenames.each do |filename|
65
- file = directory.files.get(filename)
66
- file.destroy if file
67
- end
68
-
69
- directory.destroy
70
- end
71
-
72
- end
73
- end
74
- end
@@ -1,9 +0,0 @@
1
- ##
2
- # Ninefold Cloud Storage [Storage]
3
- #
4
- store_with Ninefold do |nf|
5
- nf.storage_token = "my_storage_token"
6
- nf.storage_secret = "my_storage_secret"
7
- nf.path = "/path/to/my/backups"
8
- nf.keep = 10
9
- end