backedup 5.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +19 -0
- data/README.md +33 -0
- data/bin/backedup +5 -0
- data/bin/docker_test +24 -0
- data/lib/backup/archive.rb +169 -0
- data/lib/backup/binder.rb +18 -0
- data/lib/backup/cleaner.rb +112 -0
- data/lib/backup/cli.rb +370 -0
- data/lib/backup/cloud_io/base.rb +38 -0
- data/lib/backup/cloud_io/cloud_files.rb +296 -0
- data/lib/backup/cloud_io/gcs.rb +121 -0
- data/lib/backup/cloud_io/s3.rb +253 -0
- data/lib/backup/cloud_io/swift.rb +96 -0
- data/lib/backup/compressor/base.rb +32 -0
- data/lib/backup/compressor/bzip2.rb +35 -0
- data/lib/backup/compressor/custom.rb +49 -0
- data/lib/backup/compressor/gzip.rb +73 -0
- data/lib/backup/compressor/pbzip2.rb +45 -0
- data/lib/backup/config/dsl.rb +102 -0
- data/lib/backup/config/helpers.rb +137 -0
- data/lib/backup/config.rb +118 -0
- data/lib/backup/database/base.rb +86 -0
- data/lib/backup/database/mongodb.rb +186 -0
- data/lib/backup/database/mysql.rb +191 -0
- data/lib/backup/database/openldap.rb +93 -0
- data/lib/backup/database/postgresql.rb +164 -0
- data/lib/backup/database/redis.rb +176 -0
- data/lib/backup/database/riak.rb +79 -0
- data/lib/backup/database/sqlite.rb +55 -0
- data/lib/backup/encryptor/base.rb +27 -0
- data/lib/backup/encryptor/gpg.rb +737 -0
- data/lib/backup/encryptor/open_ssl.rb +74 -0
- data/lib/backup/errors.rb +53 -0
- data/lib/backup/logger/console.rb +48 -0
- data/lib/backup/logger/fog_adapter.rb +25 -0
- data/lib/backup/logger/logfile.rb +131 -0
- data/lib/backup/logger/syslog.rb +114 -0
- data/lib/backup/logger.rb +197 -0
- data/lib/backup/model.rb +472 -0
- data/lib/backup/notifier/base.rb +126 -0
- data/lib/backup/notifier/campfire.rb +61 -0
- data/lib/backup/notifier/command.rb +99 -0
- data/lib/backup/notifier/datadog.rb +104 -0
- data/lib/backup/notifier/flowdock.rb +99 -0
- data/lib/backup/notifier/hipchat.rb +116 -0
- data/lib/backup/notifier/http_post.rb +114 -0
- data/lib/backup/notifier/mail.rb +232 -0
- data/lib/backup/notifier/nagios.rb +65 -0
- data/lib/backup/notifier/pagerduty.rb +79 -0
- data/lib/backup/notifier/prowl.rb +68 -0
- data/lib/backup/notifier/pushover.rb +71 -0
- data/lib/backup/notifier/ses.rb +123 -0
- data/lib/backup/notifier/slack.rb +147 -0
- data/lib/backup/notifier/twitter.rb +55 -0
- data/lib/backup/notifier/zabbix.rb +60 -0
- data/lib/backup/package.rb +51 -0
- data/lib/backup/packager.rb +106 -0
- data/lib/backup/pipeline.rb +120 -0
- data/lib/backup/splitter.rb +73 -0
- data/lib/backup/storage/base.rb +66 -0
- data/lib/backup/storage/cloud_files.rb +156 -0
- data/lib/backup/storage/cycler.rb +70 -0
- data/lib/backup/storage/dropbox.rb +206 -0
- data/lib/backup/storage/ftp.rb +116 -0
- data/lib/backup/storage/gcs.rb +93 -0
- data/lib/backup/storage/local.rb +61 -0
- data/lib/backup/storage/qiniu.rb +65 -0
- data/lib/backup/storage/rsync.rb +246 -0
- data/lib/backup/storage/s3.rb +155 -0
- data/lib/backup/storage/scp.rb +65 -0
- data/lib/backup/storage/sftp.rb +80 -0
- data/lib/backup/storage/swift.rb +124 -0
- data/lib/backup/storage/webdav.rb +102 -0
- data/lib/backup/syncer/base.rb +67 -0
- data/lib/backup/syncer/cloud/base.rb +176 -0
- data/lib/backup/syncer/cloud/cloud_files.rb +81 -0
- data/lib/backup/syncer/cloud/local_file.rb +97 -0
- data/lib/backup/syncer/cloud/s3.rb +109 -0
- data/lib/backup/syncer/rsync/base.rb +50 -0
- data/lib/backup/syncer/rsync/local.rb +27 -0
- data/lib/backup/syncer/rsync/pull.rb +47 -0
- data/lib/backup/syncer/rsync/push.rb +201 -0
- data/lib/backup/template.rb +41 -0
- data/lib/backup/utilities.rb +234 -0
- data/lib/backup/version.rb +3 -0
- data/lib/backup.rb +145 -0
- data/templates/cli/archive +28 -0
- data/templates/cli/compressor/bzip2 +4 -0
- data/templates/cli/compressor/custom +7 -0
- data/templates/cli/compressor/gzip +4 -0
- data/templates/cli/config +123 -0
- data/templates/cli/databases/mongodb +15 -0
- data/templates/cli/databases/mysql +18 -0
- data/templates/cli/databases/openldap +24 -0
- data/templates/cli/databases/postgresql +16 -0
- data/templates/cli/databases/redis +16 -0
- data/templates/cli/databases/riak +17 -0
- data/templates/cli/databases/sqlite +11 -0
- data/templates/cli/encryptor/gpg +27 -0
- data/templates/cli/encryptor/openssl +9 -0
- data/templates/cli/model +26 -0
- data/templates/cli/notifier/zabbix +15 -0
- data/templates/cli/notifiers/campfire +12 -0
- data/templates/cli/notifiers/command +32 -0
- data/templates/cli/notifiers/datadog +57 -0
- data/templates/cli/notifiers/flowdock +16 -0
- data/templates/cli/notifiers/hipchat +16 -0
- data/templates/cli/notifiers/http_post +32 -0
- data/templates/cli/notifiers/mail +24 -0
- data/templates/cli/notifiers/nagios +13 -0
- data/templates/cli/notifiers/pagerduty +12 -0
- data/templates/cli/notifiers/prowl +11 -0
- data/templates/cli/notifiers/pushover +11 -0
- data/templates/cli/notifiers/ses +15 -0
- data/templates/cli/notifiers/slack +22 -0
- data/templates/cli/notifiers/twitter +13 -0
- data/templates/cli/splitter +7 -0
- data/templates/cli/storages/cloud_files +11 -0
- data/templates/cli/storages/dropbox +20 -0
- data/templates/cli/storages/ftp +13 -0
- data/templates/cli/storages/gcs +8 -0
- data/templates/cli/storages/local +8 -0
- data/templates/cli/storages/qiniu +12 -0
- data/templates/cli/storages/rsync +17 -0
- data/templates/cli/storages/s3 +16 -0
- data/templates/cli/storages/scp +15 -0
- data/templates/cli/storages/sftp +15 -0
- data/templates/cli/storages/swift +19 -0
- data/templates/cli/storages/webdav +13 -0
- data/templates/cli/syncers/cloud_files +22 -0
- data/templates/cli/syncers/rsync_local +20 -0
- data/templates/cli/syncers/rsync_pull +28 -0
- data/templates/cli/syncers/rsync_push +28 -0
- data/templates/cli/syncers/s3 +27 -0
- data/templates/general/links +3 -0
- data/templates/general/version.erb +2 -0
- data/templates/notifier/mail/failure.erb +16 -0
- data/templates/notifier/mail/success.erb +16 -0
- data/templates/notifier/mail/warning.erb +16 -0
- data/templates/storage/dropbox/authorization_url.erb +6 -0
- data/templates/storage/dropbox/authorized.erb +4 -0
- data/templates/storage/dropbox/cache_file_written.erb +10 -0
- metadata +1255 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
##
|
2
|
+
# GPG [Encryptor]
|
3
|
+
#
|
4
|
+
# Setting up #keys, as well as #gpg_homedir and #gpg_config,
|
5
|
+
# would be best set in config.rb using Encryptor::GPG.defaults
|
6
|
+
#
|
7
|
+
encrypt_with GPG do |encryption|
|
8
|
+
# Setup public keys for #recipients
|
9
|
+
encryption.keys = {}
|
10
|
+
encryption.keys['user@domain.com'] = <<-KEY
|
11
|
+
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
12
|
+
Version: GnuPG v1.4.11 (Darwin)
|
13
|
+
|
14
|
+
<Your GPG Public Key Here>
|
15
|
+
-----END PGP PUBLIC KEY BLOCK-----
|
16
|
+
KEY
|
17
|
+
|
18
|
+
# Specify mode (:asymmetric, :symmetric or :both)
|
19
|
+
encryption.mode = :both # defaults to :asymmetric
|
20
|
+
|
21
|
+
# Specify recipients from #keys (for :asymmetric encryption)
|
22
|
+
encryption.recipients = ['user@domain.com']
|
23
|
+
|
24
|
+
# Specify passphrase or passphrase_file (for :symmetric encryption)
|
25
|
+
encryption.passphrase = 'a secret'
|
26
|
+
# encryption.passphrase_file = '~/backup_passphrase'
|
27
|
+
end
|
data/templates/cli/model
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
##
|
4
|
+
# Backup Generated: <%= @options[:trigger] %>
|
5
|
+
# Once configured, you can run the backup with the following command:
|
6
|
+
#
|
7
|
+
# $ backup perform -t <%= @options[:trigger] %> [-c <path_to_configuration_file>]
|
8
|
+
#
|
9
|
+
# For more information about Backup's components, see the documentation at:
|
10
|
+
# http://backup.github.io/backup
|
11
|
+
#
|
12
|
+
Model.new(:<%= @options[:trigger] %>, 'Description for <%= @options[:trigger] %>') do
|
13
|
+
<% if @options[:splitter] %>
|
14
|
+
<%= Backup::Template.new.result('cli/splitter') %>
|
15
|
+
<% end; if @options[:archives] %>
|
16
|
+
<%= Backup::Template.new.result('cli/archive') %>
|
17
|
+
<% end; %w{ databases storages syncers encryptor compressor notifiers }.each do |item|
|
18
|
+
if @options[item]
|
19
|
+
@options[item].split(',').map(&:strip).uniq.each do |entry|
|
20
|
+
if File.exist?(File.join(Backup::TEMPLATE_PATH, 'cli', item, entry)) %>
|
21
|
+
<%= Backup::Template.new.result("cli/#{ item }/#{ entry }") %>
|
22
|
+
<% end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end %>
|
26
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
##
|
2
|
+
# Zabbix [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Zabbix do |zabbix|
|
5
|
+
zabbix.on_success = true
|
6
|
+
zabbix.on_warning = true
|
7
|
+
zabbix.on_failure = true
|
8
|
+
|
9
|
+
zabbix.zabbix_host = "zabbix_server_hostname"
|
10
|
+
zabbix.zabbix_port = 10051
|
11
|
+
zabbix.service_name = "Backup trigger"
|
12
|
+
zabbix.service_host = "zabbix_host"
|
13
|
+
zabbix.item_key = "backup_status"
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
##
|
2
|
+
# Campfire [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Campfire do |campfire|
|
5
|
+
campfire.on_success = true
|
6
|
+
campfire.on_warning = true
|
7
|
+
campfire.on_failure = true
|
8
|
+
|
9
|
+
campfire.api_token = "my_api_authentication_token"
|
10
|
+
campfire.subdomain = "my_subdomain"
|
11
|
+
campfire.room_id = "my_room_id"
|
12
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
##
|
2
|
+
# Command [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Command do |cmd|
|
5
|
+
cmd.on_success = true
|
6
|
+
cmd.on_warning = true
|
7
|
+
cmd.on_failure = true
|
8
|
+
|
9
|
+
# Command to execute
|
10
|
+
cmd.command = 'notify-send'
|
11
|
+
|
12
|
+
# Arguments to pass to the command.
|
13
|
+
#
|
14
|
+
# Must be an array of strings or callable objects.
|
15
|
+
#
|
16
|
+
# Callables will be invoked with #call(model, status),
|
17
|
+
# and the return value used as the argument.
|
18
|
+
#
|
19
|
+
# In strings you can use the following placeholders:
|
20
|
+
#
|
21
|
+
# %l - Model label
|
22
|
+
# %t - Model trigger
|
23
|
+
# %s - Status (success/failure/warning)
|
24
|
+
# %v - Status verb (succeeded/failed/succeeded with warnings)
|
25
|
+
#
|
26
|
+
# All placeholders can be used with uppercase letters to capitalize
|
27
|
+
# the value.
|
28
|
+
#
|
29
|
+
# Defaults to ["%L %v"]
|
30
|
+
#
|
31
|
+
# cmd.args = ["Backup %L", "%V"]
|
32
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
##
|
2
|
+
# DataDog [Notifier]
|
3
|
+
#
|
4
|
+
notify_by DataDog do |datadog|
|
5
|
+
datadog.on_success = true
|
6
|
+
datadog.on_warning = true
|
7
|
+
datadog.on_failure = true
|
8
|
+
|
9
|
+
datadog.api_key = 'my_api_key'
|
10
|
+
|
11
|
+
##
|
12
|
+
# Optional
|
13
|
+
#
|
14
|
+
# Override Default Title
|
15
|
+
# Default is: "Backup #{:label}"
|
16
|
+
# datadog.title = "Backup #{:status}"
|
17
|
+
#
|
18
|
+
# Override Default Text
|
19
|
+
# Default is "Backup Notification for #{:label}"
|
20
|
+
# datadog.text = "Backup #{:status} - #{:message}"
|
21
|
+
#
|
22
|
+
# Provide a hostname to associate this backup to
|
23
|
+
# Default is nil
|
24
|
+
# datadog.host = 'db.example.com'
|
25
|
+
#
|
26
|
+
# Add Tags to the Event
|
27
|
+
# Default is nil
|
28
|
+
# valid option is an Array
|
29
|
+
# datadog.tags = ['backup', 'env:production']
|
30
|
+
#
|
31
|
+
# Override the Alert Type
|
32
|
+
# Default is based on the :status of the backup:
|
33
|
+
# :success => 'success'
|
34
|
+
# :warning => 'warning'
|
35
|
+
# :failure => 'error'
|
36
|
+
# valid options are: 'info', 'success', 'warning', 'error'
|
37
|
+
# datadog.alert_type = 'info'
|
38
|
+
#
|
39
|
+
# Add a Source Type
|
40
|
+
# Default is nil
|
41
|
+
# see api docs for valid source_type_names
|
42
|
+
# datadog.source_type_name = 'my apps'
|
43
|
+
#
|
44
|
+
# Override the Priority Level
|
45
|
+
# Default is 'normal'
|
46
|
+
# valid options are: 'normal' or 'low'
|
47
|
+
# datadog.priority = 'low'
|
48
|
+
#
|
49
|
+
# Override the Event Time (must be a unix Timestamp)
|
50
|
+
# Default is Time.now.to_i
|
51
|
+
# datadog.date_happened = Time.now.to_i
|
52
|
+
#
|
53
|
+
# Add an Aggregation Key
|
54
|
+
# Default is nil
|
55
|
+
# max length allowed is 100 characters
|
56
|
+
# datadog.aggregation_key = 'my_aggregation'
|
57
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
##
|
2
|
+
# Flowdock [Notifier]
|
3
|
+
#
|
4
|
+
notify_by FlowDock do |flowdock|
|
5
|
+
flowdock.on_success = true
|
6
|
+
flowdock.on_warning = true
|
7
|
+
flowdock.on_failure = true
|
8
|
+
|
9
|
+
flowdock.token = "token"
|
10
|
+
flowdock.from_name = 'my_name'
|
11
|
+
flowdock.from_email = 'email@example.com'
|
12
|
+
flowdock.subject = 'My Daily Backup'
|
13
|
+
flowdock.source = 'Backup'
|
14
|
+
flowdock.tags = ['prod', 'backup']
|
15
|
+
flowdock.link = 'www.example.com'
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
##
|
2
|
+
# Hipchat [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Hipchat do |hipchat|
|
5
|
+
hipchat.on_success = true
|
6
|
+
hipchat.on_warning = true
|
7
|
+
hipchat.on_failure = true
|
8
|
+
|
9
|
+
hipchat.token = "token"
|
10
|
+
hipchat.from = "DB Backup"
|
11
|
+
hipchat.rooms_notified = ["activity"]
|
12
|
+
hipchat.success_color = "green"
|
13
|
+
hipchat.warning_color = "yellow"
|
14
|
+
hipchat.failure_color = "red"
|
15
|
+
hipchat.api_version = "v1"
|
16
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
##
|
2
|
+
# HttpPost [Notifier]
|
3
|
+
#
|
4
|
+
notify_by HttpPost do |post|
|
5
|
+
post.on_success = true
|
6
|
+
post.on_warning = true
|
7
|
+
post.on_failure = true
|
8
|
+
|
9
|
+
# URI to post the notification to.
|
10
|
+
# Port may be specified if needed.
|
11
|
+
# If Basic Authentication is required, supply user:pass.
|
12
|
+
post.uri = 'https://user:pass@your.domain.com:8443/path'
|
13
|
+
|
14
|
+
##
|
15
|
+
# Optional
|
16
|
+
#
|
17
|
+
# Additional headers to send.
|
18
|
+
# post.headers = { 'Authentication' => 'my_auth_info' }
|
19
|
+
#
|
20
|
+
# Additional form params to post.
|
21
|
+
# post.params = { 'auth_token' => 'my_token' }
|
22
|
+
#
|
23
|
+
# Successful response codes. Default: 200
|
24
|
+
# post.success_codes = [200, 201, 204]
|
25
|
+
#
|
26
|
+
# Defaults to true on most systems.
|
27
|
+
# Force with +true+, disable with +false+
|
28
|
+
# post.ssl_verify_peer = false
|
29
|
+
#
|
30
|
+
# Supplied by default. Override with a custom 'cacert.pem' file.
|
31
|
+
# post.ssl_ca_file = '/my/cacert.pem'
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
##
|
2
|
+
# Mail [Notifier]
|
3
|
+
#
|
4
|
+
# The default delivery method for Mail Notifiers is 'SMTP'.
|
5
|
+
# See the documentation for other delivery options.
|
6
|
+
#
|
7
|
+
notify_by Mail do |mail|
|
8
|
+
mail.on_success = true
|
9
|
+
mail.on_warning = true
|
10
|
+
mail.on_failure = true
|
11
|
+
|
12
|
+
mail.from = "sender@email.com"
|
13
|
+
mail.to = "receiver@email.com"
|
14
|
+
mail.cc = "cc@email.com"
|
15
|
+
mail.bcc = "bcc@email.com"
|
16
|
+
mail.reply_to = "reply_to@email.com"
|
17
|
+
mail.address = "smtp.gmail.com"
|
18
|
+
mail.port = 587
|
19
|
+
mail.domain = "your.host.name"
|
20
|
+
mail.user_name = "sender@email.com"
|
21
|
+
mail.password = "my_password"
|
22
|
+
mail.authentication = "plain"
|
23
|
+
mail.encryption = :starttls
|
24
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# Nagios [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Nagios do |nagios|
|
5
|
+
nagios.on_success = true
|
6
|
+
nagios.on_warning = true
|
7
|
+
nagios.on_failure = true
|
8
|
+
|
9
|
+
nagios.nagios_host = 'nagioshost'
|
10
|
+
nagios.nagios_port = 5667
|
11
|
+
nagios.service_name = 'My Backup'
|
12
|
+
nagios.service_host = 'backuphost'
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
##
|
2
|
+
# PagerDuty [Notifier]
|
3
|
+
#
|
4
|
+
|
5
|
+
notify_by PagerDuty do |pagerduty|
|
6
|
+
pagerduty.on_success = true
|
7
|
+
pagerduty.on_warning = true
|
8
|
+
pagerduty.on_failure = true
|
9
|
+
|
10
|
+
pagerduty.service_key = '0123456789abcdef01234567890abcde'
|
11
|
+
pagerduty.resolve_on_warning = true
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
##
|
2
|
+
# SES [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Ses do |ses|
|
5
|
+
ses.on_success = true
|
6
|
+
ses.on_warning = true
|
7
|
+
ses.on_failure = true
|
8
|
+
|
9
|
+
ses.access_key_id = ''
|
10
|
+
ses.secret_access_key = ''
|
11
|
+
ses.region = 'eu-west-1'
|
12
|
+
|
13
|
+
ses.from = "sender@email.com"
|
14
|
+
ses.to = "receiver@email.com"
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
##
|
2
|
+
# Slack [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Slack do |slack|
|
5
|
+
slack.on_success = true
|
6
|
+
slack.on_warning = true
|
7
|
+
slack.on_failure = true
|
8
|
+
|
9
|
+
# The incoming webhook url
|
10
|
+
# https://hooks.slack.com/services/xxxxxxxx/xxxxxxxxx/xxxxxxxxxx
|
11
|
+
slack.webhook_url = 'xxxxxxxxxxxxxxxxxxxxxxxx'
|
12
|
+
|
13
|
+
|
14
|
+
##
|
15
|
+
# Optional
|
16
|
+
#
|
17
|
+
# The channel to which messages will be sent
|
18
|
+
# slack.channel = 'my_channel'
|
19
|
+
#
|
20
|
+
# The username to display along with the notification
|
21
|
+
# slack.username = 'my_username'
|
22
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# Twitter [Notifier]
|
3
|
+
#
|
4
|
+
notify_by Twitter do |tweet|
|
5
|
+
tweet.on_success = true
|
6
|
+
tweet.on_warning = true
|
7
|
+
tweet.on_failure = true
|
8
|
+
|
9
|
+
tweet.consumer_key = "my_consumer_key"
|
10
|
+
tweet.consumer_secret = "my_consumer_secret"
|
11
|
+
tweet.oauth_token = "my_oauth_token"
|
12
|
+
tweet.oauth_token_secret = "my_oauth_token_secret"
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
##
|
2
|
+
# Rackspace Cloud Files [Storage]
|
3
|
+
#
|
4
|
+
store_with CloudFiles do |cf|
|
5
|
+
cf.api_key = 'my_api_key'
|
6
|
+
cf.username = 'my_username'
|
7
|
+
cf.container = 'my_container'
|
8
|
+
cf.segments_container = 'my_segments_container' # must be different than `container`
|
9
|
+
cf.segment_size = 5 # MiB
|
10
|
+
cf.path = 'path/to/backups' # path within the container
|
11
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
##
|
2
|
+
# Dropbox [Storage]
|
3
|
+
#
|
4
|
+
# Your initial backup must be performed manually to authorize
|
5
|
+
# this machine with your Dropbox account. This authorized session
|
6
|
+
# will be stored in `cache_path` and used for subsequent backups.
|
7
|
+
#
|
8
|
+
store_with Dropbox do |db|
|
9
|
+
db.api_key = "my_api_key"
|
10
|
+
db.api_secret = "my_api_secret"
|
11
|
+
# Sets the path where the cached authorized session will be stored.
|
12
|
+
# Relative paths will be relative to ~/Backup, unless the --root-path
|
13
|
+
# is set on the command line or within your configuration file.
|
14
|
+
db.cache_path = ".cache"
|
15
|
+
# :app_folder (default) or :dropbox
|
16
|
+
db.access_type = :app_folder
|
17
|
+
db.path = "/path/to/my/backups"
|
18
|
+
db.keep = 25
|
19
|
+
# db.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# FTP (File Transfer Protocol) [Storage]
|
3
|
+
#
|
4
|
+
store_with FTP do |server|
|
5
|
+
server.username = "my_username"
|
6
|
+
server.password = "my_password"
|
7
|
+
server.ip = "123.45.678.90"
|
8
|
+
server.port = 21
|
9
|
+
server.path = "~/backups/"
|
10
|
+
server.keep = 5
|
11
|
+
# server.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
12
|
+
server.passive_mode = false
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
##
|
2
|
+
# RSync [Storage]
|
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
|
+
# If no `host` is specified, the transfer will be a local
|
10
|
+
# operation. `mode` and `compress` will have no meaning.
|
11
|
+
#
|
12
|
+
store_with RSync do |rsync|
|
13
|
+
rsync.mode = :ssh
|
14
|
+
rsync.host = "123.45.678.90"
|
15
|
+
rsync.path = "~/backups/"
|
16
|
+
rsync.compress = true
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
##
|
2
|
+
# Amazon Simple Storage Service [Storage]
|
3
|
+
#
|
4
|
+
store_with 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.region = "us-east-1"
|
12
|
+
s3.bucket = "bucket-name"
|
13
|
+
s3.path = "path/to/backups"
|
14
|
+
s3.keep = 5
|
15
|
+
# s3.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
##
|
2
|
+
# SCP (Secure Copy) [Storage]
|
3
|
+
#
|
4
|
+
store_with SCP do |server|
|
5
|
+
server.username = "my_username"
|
6
|
+
server.password = "my_password"
|
7
|
+
server.ip = "123.45.678.90"
|
8
|
+
server.port = 22
|
9
|
+
server.path = "~/backups/"
|
10
|
+
server.keep = 5
|
11
|
+
# server.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
12
|
+
|
13
|
+
# Additional options for the SSH connection.
|
14
|
+
# server.ssh_options = {}
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
##
|
2
|
+
# SFTP (Secure File Transfer Protocol) [Storage]
|
3
|
+
#
|
4
|
+
store_with SFTP do |server|
|
5
|
+
server.username = "my_username"
|
6
|
+
server.password = "my_password"
|
7
|
+
server.ip = "123.45.678.90"
|
8
|
+
server.port = 22
|
9
|
+
server.path = "~/backups/"
|
10
|
+
server.keep = 5
|
11
|
+
# server.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
12
|
+
|
13
|
+
# Additional options for the SSH connection.
|
14
|
+
# server.ssh_options = {}
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
##
|
2
|
+
# OpenStack Swift object storage [Storage]
|
3
|
+
#
|
4
|
+
store_with Swift do |swift|
|
5
|
+
# Your OpenStack credentials
|
6
|
+
swift.auth_url = "https://my.identity.server/v2.0/tokens"
|
7
|
+
swift.username = "my_username"
|
8
|
+
swift.password = "my_password"
|
9
|
+
|
10
|
+
# If using a Keystone (v2) identity
|
11
|
+
swift.tenant_name = "my_tenant_name"
|
12
|
+
|
13
|
+
swift.container = "my_swift_container"
|
14
|
+
swift.path = "path/to/backups"
|
15
|
+
swift.keep = 5
|
16
|
+
# swift.keep = Time.now - 2592000 # Remove all backups older than 1 month.
|
17
|
+
# If your deploiement has multiple regions
|
18
|
+
# swift.region = "region"
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# Webdav [Storage]
|
3
|
+
#
|
4
|
+
store_with Webdav do |server|
|
5
|
+
server.username = "my_username"
|
6
|
+
server.password = "my_password"
|
7
|
+
server.ip = "123.45.678.90"
|
8
|
+
server.port = 443
|
9
|
+
server.use_ssl = true
|
10
|
+
server.ssl_verify = true
|
11
|
+
server.path = "remote.php/webdav/backups"
|
12
|
+
server.keep = 3
|
13
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
##
|
2
|
+
# Rackspace Cloud Files [Syncer]
|
3
|
+
#
|
4
|
+
sync_with Cloud::CloudFiles do |cf|
|
5
|
+
cf.username = "my_username"
|
6
|
+
cf.api_key = "my_api_key"
|
7
|
+
cf.container = "my_container"
|
8
|
+
cf.path = "/backups"
|
9
|
+
cf.mirror = true
|
10
|
+
cf.thread_count = 10
|
11
|
+
|
12
|
+
cf.directories do |directory|
|
13
|
+
directory.add "/path/to/directory/to/sync"
|
14
|
+
directory.add "/path/to/other/directory/to/sync"
|
15
|
+
|
16
|
+
# Exclude files/folders from the sync.
|
17
|
+
# The pattern may be a shell glob pattern (see `File.fnmatch`) or a Regexp.
|
18
|
+
# All patterns will be applied when traversing each added directory.
|
19
|
+
directory.exclude '**/*~'
|
20
|
+
directory.exclude /\/tmp$/
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
##
|
2
|
+
# RSync::Local [Syncer]
|
3
|
+
#
|
4
|
+
sync_with RSync::Local do |rsync|
|
5
|
+
rsync.path = "~/backups"
|
6
|
+
rsync.mirror = true
|
7
|
+
|
8
|
+
rsync.directories do |directory|
|
9
|
+
directory.add "/var/apps/my_app/public/uploads"
|
10
|
+
directory.add "/var/apps/my_app/logs"
|
11
|
+
|
12
|
+
# Exclude files/folders.
|
13
|
+
# Each pattern will be passed to rsync's `--exclude` option.
|
14
|
+
#
|
15
|
+
# Note: rsync is run using the `--archive` option,
|
16
|
+
# so be sure to read the `FILTER RULES` in `man rsync`.
|
17
|
+
directory.exclude '*~'
|
18
|
+
directory.exclude 'tmp/'
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
##
|
2
|
+
# RSync::Pull [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::Pull 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
|