sliday_backup 0.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 +7 -0
- data/README.md +29 -0
- data/bin/sliday_backup +5 -0
- data/lib/sliday_backup.rb +147 -0
- data/lib/sliday_backup/archive.rb +170 -0
- data/lib/sliday_backup/binder.rb +22 -0
- data/lib/sliday_backup/cleaner.rb +116 -0
- data/lib/sliday_backup/cli.rb +374 -0
- data/lib/sliday_backup/cloud_io/base.rb +41 -0
- data/lib/sliday_backup/cloud_io/cloud_files.rb +298 -0
- data/lib/sliday_backup/cloud_io/s3.rb +260 -0
- data/lib/sliday_backup/compressor/base.rb +35 -0
- data/lib/sliday_backup/compressor/bzip2.rb +39 -0
- data/lib/sliday_backup/compressor/custom.rb +53 -0
- data/lib/sliday_backup/compressor/gzip.rb +74 -0
- data/lib/sliday_backup/config.rb +119 -0
- data/lib/sliday_backup/config/dsl.rb +103 -0
- data/lib/sliday_backup/config/helpers.rb +143 -0
- data/lib/sliday_backup/database/base.rb +86 -0
- data/lib/sliday_backup/database/mongodb.rb +187 -0
- data/lib/sliday_backup/database/mysql.rb +192 -0
- data/lib/sliday_backup/database/openldap.rb +95 -0
- data/lib/sliday_backup/database/postgresql.rb +133 -0
- data/lib/sliday_backup/database/redis.rb +179 -0
- data/lib/sliday_backup/database/riak.rb +82 -0
- data/lib/sliday_backup/database/sqlite.rb +57 -0
- data/lib/sliday_backup/encryptor/base.rb +29 -0
- data/lib/sliday_backup/encryptor/gpg.rb +747 -0
- data/lib/sliday_backup/encryptor/open_ssl.rb +77 -0
- data/lib/sliday_backup/errors.rb +58 -0
- data/lib/sliday_backup/logger.rb +199 -0
- data/lib/sliday_backup/logger/console.rb +51 -0
- data/lib/sliday_backup/logger/fog_adapter.rb +29 -0
- data/lib/sliday_backup/logger/logfile.rb +133 -0
- data/lib/sliday_backup/logger/syslog.rb +116 -0
- data/lib/sliday_backup/model.rb +479 -0
- data/lib/sliday_backup/notifier/base.rb +128 -0
- data/lib/sliday_backup/notifier/campfire.rb +63 -0
- data/lib/sliday_backup/notifier/command.rb +99 -0
- data/lib/sliday_backup/notifier/datadog.rb +107 -0
- data/lib/sliday_backup/notifier/flowdock.rb +103 -0
- data/lib/sliday_backup/notifier/hipchat.rb +112 -0
- data/lib/sliday_backup/notifier/http_post.rb +117 -0
- data/lib/sliday_backup/notifier/mail.rb +244 -0
- data/lib/sliday_backup/notifier/nagios.rb +69 -0
- data/lib/sliday_backup/notifier/pagerduty.rb +81 -0
- data/lib/sliday_backup/notifier/prowl.rb +68 -0
- data/lib/sliday_backup/notifier/pushover.rb +74 -0
- data/lib/sliday_backup/notifier/ses.rb +88 -0
- data/lib/sliday_backup/notifier/slack.rb +148 -0
- data/lib/sliday_backup/notifier/twitter.rb +58 -0
- data/lib/sliday_backup/notifier/zabbix.rb +63 -0
- data/lib/sliday_backup/package.rb +55 -0
- data/lib/sliday_backup/packager.rb +107 -0
- data/lib/sliday_backup/pipeline.rb +124 -0
- data/lib/sliday_backup/splitter.rb +76 -0
- data/lib/sliday_backup/storage/base.rb +69 -0
- data/lib/sliday_backup/storage/cloud_files.rb +158 -0
- data/lib/sliday_backup/storage/cycler.rb +75 -0
- data/lib/sliday_backup/storage/dropbox.rb +212 -0
- data/lib/sliday_backup/storage/ftp.rb +112 -0
- data/lib/sliday_backup/storage/local.rb +64 -0
- data/lib/sliday_backup/storage/qiniu.rb +65 -0
- data/lib/sliday_backup/storage/rsync.rb +248 -0
- data/lib/sliday_backup/storage/s3.rb +156 -0
- data/lib/sliday_backup/storage/scp.rb +67 -0
- data/lib/sliday_backup/storage/sftp.rb +82 -0
- data/lib/sliday_backup/storage/sliday_storage.rb +79 -0
- data/lib/sliday_backup/syncer/base.rb +70 -0
- data/lib/sliday_backup/syncer/cloud/base.rb +179 -0
- data/lib/sliday_backup/syncer/cloud/cloud_files.rb +83 -0
- data/lib/sliday_backup/syncer/cloud/local_file.rb +100 -0
- data/lib/sliday_backup/syncer/cloud/s3.rb +110 -0
- data/lib/sliday_backup/syncer/rsync/base.rb +54 -0
- data/lib/sliday_backup/syncer/rsync/local.rb +31 -0
- data/lib/sliday_backup/syncer/rsync/pull.rb +51 -0
- data/lib/sliday_backup/syncer/rsync/push.rb +205 -0
- data/lib/sliday_backup/template.rb +46 -0
- data/lib/sliday_backup/utilities.rb +224 -0
- data/lib/sliday_backup/version.rb +5 -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/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/sliday_storage +6 -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 +1079 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Archive [Archive]
|
|
3
|
+
#
|
|
4
|
+
# Adding a file or directory (including sub-directories):
|
|
5
|
+
# archive.add "/path/to/a/file.rb"
|
|
6
|
+
# archive.add "/path/to/a/directory/"
|
|
7
|
+
#
|
|
8
|
+
# Excluding a file or directory (including sub-directories):
|
|
9
|
+
# archive.exclude "/path/to/an/excluded_file.rb"
|
|
10
|
+
# archive.exclude "/path/to/an/excluded_directory
|
|
11
|
+
#
|
|
12
|
+
# By default, relative paths will be relative to the directory
|
|
13
|
+
# where `backup perform` is executed, and they will be expanded
|
|
14
|
+
# to the root of the filesystem when added to the archive.
|
|
15
|
+
#
|
|
16
|
+
# If a `root` path is set, relative paths will be relative to the
|
|
17
|
+
# given `root` path and will not be expanded when added to the archive.
|
|
18
|
+
#
|
|
19
|
+
# archive.root '/path/to/archive/root'
|
|
20
|
+
#
|
|
21
|
+
archive :my_archive do |archive|
|
|
22
|
+
# Run the `tar` command using `sudo`
|
|
23
|
+
# archive.use_sudo
|
|
24
|
+
archive.add "/path/to/a/file.rb"
|
|
25
|
+
archive.add "/path/to/a/folder/"
|
|
26
|
+
archive.exclude "/path/to/a/excluded_file.rb"
|
|
27
|
+
archive.exclude "/path/to/a/excluded_folder"
|
|
28
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
##
|
|
4
|
+
# SlidayBackup v<%= SlidayBackup::VERSION.split('.').first %>.x Configuration
|
|
5
|
+
#
|
|
6
|
+
# Documentation: http://backup.github.io/backup
|
|
7
|
+
# Issue Tracker: https://github.com/backup/backup/issues
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
# Config Options
|
|
11
|
+
#
|
|
12
|
+
# The options here may be overridden on the command line, but the result
|
|
13
|
+
# will depend on the use of --root-path on the command line.
|
|
14
|
+
#
|
|
15
|
+
# If --root-path is used on the command line, then all paths set here
|
|
16
|
+
# will be overridden. If a path (like --tmp-path) is not given along with
|
|
17
|
+
# --root-path, that path will use it's default location _relative to --root-path_.
|
|
18
|
+
#
|
|
19
|
+
# If --root-path is not used on the command line, a path option (like --tmp-path)
|
|
20
|
+
# given on the command line will override the tmp_path set here, but all other
|
|
21
|
+
# paths set here will be used.
|
|
22
|
+
#
|
|
23
|
+
# Note that relative paths given on the command line without --root-path
|
|
24
|
+
# are relative to the current directory. The root_path set here only applies
|
|
25
|
+
# to relative paths set here.
|
|
26
|
+
#
|
|
27
|
+
# ---
|
|
28
|
+
#
|
|
29
|
+
# Sets the root path for all relative paths, including default paths.
|
|
30
|
+
# May be an absolute path, or relative to the current working directory.
|
|
31
|
+
#
|
|
32
|
+
# root_path 'my/root'
|
|
33
|
+
#
|
|
34
|
+
# Sets the path where backups are processed until they're stored.
|
|
35
|
+
# This must have enough free space to hold apx. 2 backups.
|
|
36
|
+
# May be an absolute path, or relative to the current directory or +root_path+.
|
|
37
|
+
#
|
|
38
|
+
# tmp_path 'my/tmp'
|
|
39
|
+
#
|
|
40
|
+
# Sets the path where backup stores persistent information.
|
|
41
|
+
# When SlidayBackup's Cycler is used, small YAML files are stored here.
|
|
42
|
+
# May be an absolute path, or relative to the current directory or +root_path+.
|
|
43
|
+
#
|
|
44
|
+
# data_path 'my/data'
|
|
45
|
+
|
|
46
|
+
##
|
|
47
|
+
# Utilities
|
|
48
|
+
#
|
|
49
|
+
# If you need to use a utility other than the one SlidayBackup detects,
|
|
50
|
+
# or a utility can not be found in your $PATH.
|
|
51
|
+
#
|
|
52
|
+
# Utilities.configure do
|
|
53
|
+
# tar '/usr/bin/gnutar'
|
|
54
|
+
# redis_cli '/opt/redis/redis-cli'
|
|
55
|
+
# end
|
|
56
|
+
|
|
57
|
+
##
|
|
58
|
+
# Logging
|
|
59
|
+
#
|
|
60
|
+
# Logging options may be set on the command line, but certain settings
|
|
61
|
+
# may only be configured here.
|
|
62
|
+
#
|
|
63
|
+
# Logger.configure do
|
|
64
|
+
# console.quiet = true # Same as command line: --quiet
|
|
65
|
+
# logfile.max_bytes = 2_000_000 # Default: 500_000
|
|
66
|
+
# syslog.enabled = true # Same as command line: --syslog
|
|
67
|
+
# syslog.ident = 'my_app_backup' # Default: 'backup'
|
|
68
|
+
# end
|
|
69
|
+
#
|
|
70
|
+
# Command line options will override those set here.
|
|
71
|
+
# For example, the following would override the example settings above
|
|
72
|
+
# to disable syslog and enable console output.
|
|
73
|
+
# backup perform --trigger my_backup --no-syslog --no-quiet
|
|
74
|
+
|
|
75
|
+
##
|
|
76
|
+
# Component Defaults
|
|
77
|
+
#
|
|
78
|
+
# Set default options to be applied to components in all models.
|
|
79
|
+
# Options set within a model will override those set here.
|
|
80
|
+
#
|
|
81
|
+
# Storage::S3.defaults do |s3|
|
|
82
|
+
# s3.access_key_id = "my_access_key_id"
|
|
83
|
+
# s3.secret_access_key = "my_secret_access_key"
|
|
84
|
+
# end
|
|
85
|
+
#
|
|
86
|
+
# Notifier::Mail.defaults do |mail|
|
|
87
|
+
# mail.from = 'sender@email.com'
|
|
88
|
+
# mail.to = 'receiver@email.com'
|
|
89
|
+
# mail.address = 'smtp.gmail.com'
|
|
90
|
+
# mail.port = 587
|
|
91
|
+
# mail.domain = 'your.host.name'
|
|
92
|
+
# mail.user_name = 'sender@email.com'
|
|
93
|
+
# mail.password = 'my_password'
|
|
94
|
+
# mail.authentication = 'plain'
|
|
95
|
+
# mail.encryption = :starttls
|
|
96
|
+
# end
|
|
97
|
+
|
|
98
|
+
##
|
|
99
|
+
# Preconfigured Models
|
|
100
|
+
#
|
|
101
|
+
# Create custom models with preconfigured components.
|
|
102
|
+
# Components added within the model definition will
|
|
103
|
+
# +add to+ the preconfigured components.
|
|
104
|
+
#
|
|
105
|
+
# preconfigure 'MyModel' do
|
|
106
|
+
# archive :user_pictures do |archive|
|
|
107
|
+
# archive.add '~/pictures'
|
|
108
|
+
# end
|
|
109
|
+
#
|
|
110
|
+
# notify_by Mail do |mail|
|
|
111
|
+
# mail.to = 'admin@email.com'
|
|
112
|
+
# end
|
|
113
|
+
# end
|
|
114
|
+
#
|
|
115
|
+
# MyModel.new(:john_smith, 'John Smith SlidayBackup') do
|
|
116
|
+
# archive :user_music do |archive|
|
|
117
|
+
# archive.add '~/music'
|
|
118
|
+
# end
|
|
119
|
+
#
|
|
120
|
+
# notify_by Mail do |mail|
|
|
121
|
+
# mail.to = 'john.smith@email.com'
|
|
122
|
+
# end
|
|
123
|
+
# end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
##
|
|
2
|
+
# MongoDB [Database]
|
|
3
|
+
#
|
|
4
|
+
database MongoDB do |db|
|
|
5
|
+
db.name = "my_database_name"
|
|
6
|
+
db.username = "my_username"
|
|
7
|
+
db.password = "my_password"
|
|
8
|
+
db.host = "localhost"
|
|
9
|
+
db.port = 27017
|
|
10
|
+
db.ipv6 = false
|
|
11
|
+
db.only_collections = ["only", "these", "collections"]
|
|
12
|
+
db.additional_options = []
|
|
13
|
+
db.lock = false
|
|
14
|
+
db.oplog = false
|
|
15
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
##
|
|
2
|
+
# MySQL [Database]
|
|
3
|
+
#
|
|
4
|
+
database MySQL do |db|
|
|
5
|
+
# To dump all databases, set `db.name = :all` (or leave blank)
|
|
6
|
+
db.name = "my_database_name"
|
|
7
|
+
db.username = "my_username"
|
|
8
|
+
db.password = "my_password"
|
|
9
|
+
db.host = "localhost"
|
|
10
|
+
db.port = 3306
|
|
11
|
+
db.socket = "/tmp/mysql.sock"
|
|
12
|
+
# Note: when using `skip_tables` with the `db.name = :all` option,
|
|
13
|
+
# table names should be prefixed with a database name.
|
|
14
|
+
# e.g. ["db_name.table_to_skip", ...]
|
|
15
|
+
db.skip_tables = ["skip", "these", "tables"]
|
|
16
|
+
db.only_tables = ["only", "these", "tables"]
|
|
17
|
+
db.additional_options = ["--quick", "--single-transaction"]
|
|
18
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
##
|
|
2
|
+
# OpenLDAP [Database]
|
|
3
|
+
#
|
|
4
|
+
database OpenLDAP do |db|
|
|
5
|
+
# Name of the ldap backup
|
|
6
|
+
db.name = "my_database_name"
|
|
7
|
+
|
|
8
|
+
# Additional "slapcat" options
|
|
9
|
+
# defaults to an empty list of options
|
|
10
|
+
# db.slapcat_args = []
|
|
11
|
+
|
|
12
|
+
# run slapcat under sudo if needed
|
|
13
|
+
# defaults to "false"
|
|
14
|
+
# db.use_sudo = true
|
|
15
|
+
|
|
16
|
+
# Stores the location of the slapd.conf,
|
|
17
|
+
# defaults to "/etc/ldap/slapd.d" confdir
|
|
18
|
+
# you can use also conf file instead of directory
|
|
19
|
+
# db.slapcat_conf = /path/to/slapd.conf
|
|
20
|
+
|
|
21
|
+
# Optional: Use to set the location of slapcat utility
|
|
22
|
+
# if it cannot be found by name in your $PATH
|
|
23
|
+
# db.slapcat_utility = "/opt/local/bin/slapcat"
|
|
24
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
##
|
|
2
|
+
# PostgreSQL [Database]
|
|
3
|
+
#
|
|
4
|
+
database PostgreSQL do |db|
|
|
5
|
+
# To dump all databases, set `db.name = :all` (or leave blank)
|
|
6
|
+
db.name = "my_database_name"
|
|
7
|
+
db.username = "my_username"
|
|
8
|
+
db.password = "my_password"
|
|
9
|
+
db.host = "localhost"
|
|
10
|
+
db.port = 5432
|
|
11
|
+
# db.socket = "/tmp/pg.sock"
|
|
12
|
+
# When dumping all databases, `skip_tables` and `only_tables` are ignored.
|
|
13
|
+
# db.skip_tables = ["skip", "these", "tables"]
|
|
14
|
+
# db.only_tables = ["only", "these", "tables"]
|
|
15
|
+
# db.additional_options = ["-xc", "-E=utf8"]
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Redis [Database]
|
|
3
|
+
#
|
|
4
|
+
database Redis do |db|
|
|
5
|
+
db.mode = :copy # or :sync
|
|
6
|
+
# Full path to redis dump file for :copy mode.
|
|
7
|
+
db.rdb_path = '/var/lib/redis/dump.rdb'
|
|
8
|
+
# When :copy mode is used, perform a SAVE before
|
|
9
|
+
# copying the dump file specified by `rdb_path`.
|
|
10
|
+
db.invoke_save = false
|
|
11
|
+
db.host = 'localhost'
|
|
12
|
+
db.port = 6379
|
|
13
|
+
db.socket = '/tmp/redis.sock'
|
|
14
|
+
db.password = 'my_password'
|
|
15
|
+
db.additional_options = []
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Riak [Database]
|
|
3
|
+
#
|
|
4
|
+
database Riak do |db|
|
|
5
|
+
##
|
|
6
|
+
# The node from which to perform the backup.
|
|
7
|
+
# default: 'riak@127.0.0.1'
|
|
8
|
+
db.node = 'riak@hostname'
|
|
9
|
+
##
|
|
10
|
+
# The Erlang cookie/shared secret used to connect to the node.
|
|
11
|
+
# default: 'riak'
|
|
12
|
+
db.cookie = 'cookie'
|
|
13
|
+
##
|
|
14
|
+
# The user for the Riak instance.
|
|
15
|
+
# default: 'riak'
|
|
16
|
+
db.user = 'riak'
|
|
17
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
##
|
|
2
|
+
# SQLite [Database]
|
|
3
|
+
#
|
|
4
|
+
database SQLite do |db|
|
|
5
|
+
# Path to database file
|
|
6
|
+
db.path = "/path/to/my/sqlite/db.sqlite"
|
|
7
|
+
|
|
8
|
+
# Optional: Use to set the location of this utility
|
|
9
|
+
# if it cannot be found by name in your $PATH
|
|
10
|
+
db.sqlitedump_utility = "/opt/local/bin/sqlite3"
|
|
11
|
+
end
|
|
@@ -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
|
+
# SlidayBackup 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 SlidayBackup'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
|
+
<%= SlidayBackup::Template.new.result('cli/splitter') %>
|
|
15
|
+
<% end; if @options[:archives] %>
|
|
16
|
+
<%= SlidayBackup::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(SlidayBackup::TEMPLATE_PATH, 'cli', item, entry)) %>
|
|
21
|
+
<%= SlidayBackup::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 = "SlidayBackup 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 = ["SlidayBackup %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: "SlidayBackup #{:label}"
|
|
16
|
+
# datadog.title = "SlidayBackup #{:status}"
|
|
17
|
+
#
|
|
18
|
+
# Override Default Text
|
|
19
|
+
# Default is "SlidayBackup Notification for #{:label}"
|
|
20
|
+
# datadog.text = "SlidayBackup #{: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
|