backedup 5.0.0.beta.3

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 (144) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +19 -0
  3. data/README.md +33 -0
  4. data/bin/backedup +5 -0
  5. data/bin/docker_test +24 -0
  6. data/lib/backup/archive.rb +169 -0
  7. data/lib/backup/binder.rb +18 -0
  8. data/lib/backup/cleaner.rb +112 -0
  9. data/lib/backup/cli.rb +370 -0
  10. data/lib/backup/cloud_io/base.rb +38 -0
  11. data/lib/backup/cloud_io/cloud_files.rb +296 -0
  12. data/lib/backup/cloud_io/gcs.rb +121 -0
  13. data/lib/backup/cloud_io/s3.rb +253 -0
  14. data/lib/backup/cloud_io/swift.rb +96 -0
  15. data/lib/backup/compressor/base.rb +32 -0
  16. data/lib/backup/compressor/bzip2.rb +35 -0
  17. data/lib/backup/compressor/custom.rb +49 -0
  18. data/lib/backup/compressor/gzip.rb +73 -0
  19. data/lib/backup/compressor/pbzip2.rb +45 -0
  20. data/lib/backup/config/dsl.rb +102 -0
  21. data/lib/backup/config/helpers.rb +137 -0
  22. data/lib/backup/config.rb +118 -0
  23. data/lib/backup/database/base.rb +86 -0
  24. data/lib/backup/database/mongodb.rb +186 -0
  25. data/lib/backup/database/mysql.rb +191 -0
  26. data/lib/backup/database/openldap.rb +93 -0
  27. data/lib/backup/database/postgresql.rb +164 -0
  28. data/lib/backup/database/redis.rb +176 -0
  29. data/lib/backup/database/riak.rb +79 -0
  30. data/lib/backup/database/sqlite.rb +55 -0
  31. data/lib/backup/encryptor/base.rb +27 -0
  32. data/lib/backup/encryptor/gpg.rb +737 -0
  33. data/lib/backup/encryptor/open_ssl.rb +74 -0
  34. data/lib/backup/errors.rb +53 -0
  35. data/lib/backup/logger/console.rb +48 -0
  36. data/lib/backup/logger/fog_adapter.rb +25 -0
  37. data/lib/backup/logger/logfile.rb +131 -0
  38. data/lib/backup/logger/syslog.rb +114 -0
  39. data/lib/backup/logger.rb +197 -0
  40. data/lib/backup/model.rb +472 -0
  41. data/lib/backup/notifier/base.rb +126 -0
  42. data/lib/backup/notifier/campfire.rb +61 -0
  43. data/lib/backup/notifier/command.rb +99 -0
  44. data/lib/backup/notifier/datadog.rb +104 -0
  45. data/lib/backup/notifier/flowdock.rb +99 -0
  46. data/lib/backup/notifier/hipchat.rb +116 -0
  47. data/lib/backup/notifier/http_post.rb +114 -0
  48. data/lib/backup/notifier/mail.rb +232 -0
  49. data/lib/backup/notifier/nagios.rb +65 -0
  50. data/lib/backup/notifier/pagerduty.rb +79 -0
  51. data/lib/backup/notifier/prowl.rb +68 -0
  52. data/lib/backup/notifier/pushover.rb +71 -0
  53. data/lib/backup/notifier/ses.rb +123 -0
  54. data/lib/backup/notifier/slack.rb +147 -0
  55. data/lib/backup/notifier/twitter.rb +55 -0
  56. data/lib/backup/notifier/zabbix.rb +60 -0
  57. data/lib/backup/package.rb +51 -0
  58. data/lib/backup/packager.rb +106 -0
  59. data/lib/backup/pipeline.rb +120 -0
  60. data/lib/backup/splitter.rb +73 -0
  61. data/lib/backup/storage/base.rb +66 -0
  62. data/lib/backup/storage/cloud_files.rb +156 -0
  63. data/lib/backup/storage/cycler.rb +70 -0
  64. data/lib/backup/storage/dropbox.rb +206 -0
  65. data/lib/backup/storage/ftp.rb +116 -0
  66. data/lib/backup/storage/gcs.rb +93 -0
  67. data/lib/backup/storage/local.rb +61 -0
  68. data/lib/backup/storage/qiniu.rb +65 -0
  69. data/lib/backup/storage/rsync.rb +246 -0
  70. data/lib/backup/storage/s3.rb +155 -0
  71. data/lib/backup/storage/scp.rb +65 -0
  72. data/lib/backup/storage/sftp.rb +80 -0
  73. data/lib/backup/storage/swift.rb +124 -0
  74. data/lib/backup/storage/webdav.rb +102 -0
  75. data/lib/backup/syncer/base.rb +67 -0
  76. data/lib/backup/syncer/cloud/base.rb +176 -0
  77. data/lib/backup/syncer/cloud/cloud_files.rb +81 -0
  78. data/lib/backup/syncer/cloud/local_file.rb +97 -0
  79. data/lib/backup/syncer/cloud/s3.rb +109 -0
  80. data/lib/backup/syncer/rsync/base.rb +50 -0
  81. data/lib/backup/syncer/rsync/local.rb +27 -0
  82. data/lib/backup/syncer/rsync/pull.rb +47 -0
  83. data/lib/backup/syncer/rsync/push.rb +201 -0
  84. data/lib/backup/template.rb +41 -0
  85. data/lib/backup/utilities.rb +234 -0
  86. data/lib/backup/version.rb +3 -0
  87. data/lib/backup.rb +145 -0
  88. data/templates/cli/archive +28 -0
  89. data/templates/cli/compressor/bzip2 +4 -0
  90. data/templates/cli/compressor/custom +7 -0
  91. data/templates/cli/compressor/gzip +4 -0
  92. data/templates/cli/config +123 -0
  93. data/templates/cli/databases/mongodb +15 -0
  94. data/templates/cli/databases/mysql +18 -0
  95. data/templates/cli/databases/openldap +24 -0
  96. data/templates/cli/databases/postgresql +16 -0
  97. data/templates/cli/databases/redis +16 -0
  98. data/templates/cli/databases/riak +17 -0
  99. data/templates/cli/databases/sqlite +11 -0
  100. data/templates/cli/encryptor/gpg +27 -0
  101. data/templates/cli/encryptor/openssl +9 -0
  102. data/templates/cli/model +26 -0
  103. data/templates/cli/notifier/zabbix +15 -0
  104. data/templates/cli/notifiers/campfire +12 -0
  105. data/templates/cli/notifiers/command +32 -0
  106. data/templates/cli/notifiers/datadog +57 -0
  107. data/templates/cli/notifiers/flowdock +16 -0
  108. data/templates/cli/notifiers/hipchat +16 -0
  109. data/templates/cli/notifiers/http_post +32 -0
  110. data/templates/cli/notifiers/mail +24 -0
  111. data/templates/cli/notifiers/nagios +13 -0
  112. data/templates/cli/notifiers/pagerduty +12 -0
  113. data/templates/cli/notifiers/prowl +11 -0
  114. data/templates/cli/notifiers/pushover +11 -0
  115. data/templates/cli/notifiers/ses +15 -0
  116. data/templates/cli/notifiers/slack +22 -0
  117. data/templates/cli/notifiers/twitter +13 -0
  118. data/templates/cli/splitter +7 -0
  119. data/templates/cli/storages/cloud_files +11 -0
  120. data/templates/cli/storages/dropbox +20 -0
  121. data/templates/cli/storages/ftp +13 -0
  122. data/templates/cli/storages/gcs +8 -0
  123. data/templates/cli/storages/local +8 -0
  124. data/templates/cli/storages/qiniu +12 -0
  125. data/templates/cli/storages/rsync +17 -0
  126. data/templates/cli/storages/s3 +16 -0
  127. data/templates/cli/storages/scp +15 -0
  128. data/templates/cli/storages/sftp +15 -0
  129. data/templates/cli/storages/swift +19 -0
  130. data/templates/cli/storages/webdav +13 -0
  131. data/templates/cli/syncers/cloud_files +22 -0
  132. data/templates/cli/syncers/rsync_local +20 -0
  133. data/templates/cli/syncers/rsync_pull +28 -0
  134. data/templates/cli/syncers/rsync_push +28 -0
  135. data/templates/cli/syncers/s3 +27 -0
  136. data/templates/general/links +3 -0
  137. data/templates/general/version.erb +2 -0
  138. data/templates/notifier/mail/failure.erb +16 -0
  139. data/templates/notifier/mail/success.erb +16 -0
  140. data/templates/notifier/mail/warning.erb +16 -0
  141. data/templates/storage/dropbox/authorization_url.erb +6 -0
  142. data/templates/storage/dropbox/authorized.erb +4 -0
  143. data/templates/storage/dropbox/cache_file_written.erb +10 -0
  144. metadata +1255 -0
@@ -0,0 +1,28 @@
1
+ ##
2
+ # RSync::Push [Syncer]
3
+ #
4
+ # The default `mode` is :ssh, which does not require the use
5
+ # of an rsync daemon on the remote. If you wish to connect
6
+ # directly to an rsync daemon, or via SSH using daemon features,
7
+ # :rsync_daemon and :ssh_daemon modes are also available.
8
+ #
9
+ sync_with RSync::Push do |rsync|
10
+ rsync.mode = :ssh
11
+ rsync.host = "123.45.678.90"
12
+ rsync.path = "~/backups"
13
+ rsync.mirror = true
14
+ rsync.compress = true
15
+
16
+ rsync.directories do |directory|
17
+ directory.add "/var/apps/my_app/public/uploads"
18
+ directory.add "/var/apps/my_app/logs"
19
+
20
+ # Exclude files/folders.
21
+ # Each pattern will be passed to rsync's `--exclude` option.
22
+ #
23
+ # Note: rsync is run using the `--archive` option,
24
+ # so be sure to read the `FILTER RULES` in `man rsync`.
25
+ directory.exclude '*~'
26
+ directory.exclude 'tmp/'
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ ##
2
+ # Amazon S3 [Syncer]
3
+ #
4
+ sync_with Cloud::S3 do |s3|
5
+ # AWS Credentials
6
+ s3.access_key_id = "my_access_key_id"
7
+ s3.secret_access_key = "my_secret_access_key"
8
+ # Or, to use a IAM Profile:
9
+ # s3.use_iam_profile = true
10
+
11
+ s3.bucket = "my-bucket"
12
+ s3.region = "us-east-1"
13
+ s3.path = "/backups"
14
+ s3.mirror = true
15
+ s3.thread_count = 10
16
+
17
+ s3.directories do |directory|
18
+ directory.add "/path/to/directory/to/sync"
19
+ directory.add "/path/to/other/directory/to/sync"
20
+
21
+ # Exclude files/folders from the sync.
22
+ # The pattern may be a shell glob pattern (see `File.fnmatch`) or a Regexp.
23
+ # All patterns will be applied when traversing each added directory.
24
+ directory.exclude '**/*~'
25
+ directory.exclude /\/tmp$/
26
+ end
27
+ end
@@ -0,0 +1,3 @@
1
+ Project Home: https://github.com/backup/backup
2
+ Documentation: http://backup.github.io/backup
3
+ Issue Tracker: https://github.com/backup/backup/issues
@@ -0,0 +1,2 @@
1
+ Backup v<%= Backup::VERSION %>
2
+ Ruby: <%= RUBY_DESCRIPTION %>
@@ -0,0 +1,16 @@
1
+
2
+ Backup Failed!
3
+
4
+ Job: <%= @model.label %> (<%= @model.trigger %>)
5
+ Started: <%= @model.started_at %>
6
+ Finished: <%= @model.finished_at %>
7
+ Duration: <%= @model.duration %>
8
+ <% if @send_log %>
9
+
10
+ See the attached backup log for details.
11
+ <% end %>
12
+
13
+ ===========================================================================
14
+ <%= Backup::Template.new.result("general/version.erb") %>
15
+
16
+ <%= Backup::Template.new.result("general/links") %>
@@ -0,0 +1,16 @@
1
+
2
+ Backup Completed Successfully!
3
+
4
+ Job: <%= @model.label %> (<%= @model.trigger %>)
5
+ Started: <%= @model.started_at %>
6
+ Finished: <%= @model.finished_at %>
7
+ Duration: <%= @model.duration %>
8
+ <% if @send_log %>
9
+
10
+ See the attached backup log for details.
11
+ <% end %>
12
+
13
+ ===========================================================================
14
+ <%= Backup::Template.new.result("general/version.erb") %>
15
+
16
+ <%= Backup::Template.new.result("general/links") %>
@@ -0,0 +1,16 @@
1
+
2
+ Backup Completed Successfully (with Warnings)!
3
+
4
+ Job: <%= @model.label %> (<%= @model.trigger %>)
5
+ Started: <%= @model.started_at %>
6
+ Finished: <%= @model.finished_at %>
7
+ Duration: <%= @model.duration %>
8
+ <% if @send_log %>
9
+
10
+ See the attached backup log for details.
11
+ <% end %>
12
+
13
+ ===========================================================================
14
+ <%= Backup::Template.new.result("general/version.erb") %>
15
+
16
+ <%= Backup::Template.new.result("general/links") %>
@@ -0,0 +1,6 @@
1
+
2
+ Visit the following URL to authorize your Dropbox App with Backup:
3
+
4
+ <%= @session.get_authorize_url %>
5
+
6
+ Hit "Enter/Return" once you're authorized.
@@ -0,0 +1,4 @@
1
+
2
+ Backup has successfully been authorized!
3
+ Writing session cache file to:
4
+ <%= @cached_file %>
@@ -0,0 +1,10 @@
1
+
2
+ Cache data written! You will no longer need to manually authorize this
3
+ Dropbox account via an authorization URL on this machine.
4
+
5
+ Note: If you run Backup with this Dropbox account in another location,
6
+ or on other machines, you will need to either authorize them the same
7
+ way, or simply copy over the cache file from:
8
+ <%= @cached_file %>
9
+ to the cache directory on your other machines to use this Dropbox
10
+ account there as well.