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,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,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,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.
|