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.
Files changed (135) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +29 -0
  3. data/bin/sliday_backup +5 -0
  4. data/lib/sliday_backup.rb +147 -0
  5. data/lib/sliday_backup/archive.rb +170 -0
  6. data/lib/sliday_backup/binder.rb +22 -0
  7. data/lib/sliday_backup/cleaner.rb +116 -0
  8. data/lib/sliday_backup/cli.rb +374 -0
  9. data/lib/sliday_backup/cloud_io/base.rb +41 -0
  10. data/lib/sliday_backup/cloud_io/cloud_files.rb +298 -0
  11. data/lib/sliday_backup/cloud_io/s3.rb +260 -0
  12. data/lib/sliday_backup/compressor/base.rb +35 -0
  13. data/lib/sliday_backup/compressor/bzip2.rb +39 -0
  14. data/lib/sliday_backup/compressor/custom.rb +53 -0
  15. data/lib/sliday_backup/compressor/gzip.rb +74 -0
  16. data/lib/sliday_backup/config.rb +119 -0
  17. data/lib/sliday_backup/config/dsl.rb +103 -0
  18. data/lib/sliday_backup/config/helpers.rb +143 -0
  19. data/lib/sliday_backup/database/base.rb +86 -0
  20. data/lib/sliday_backup/database/mongodb.rb +187 -0
  21. data/lib/sliday_backup/database/mysql.rb +192 -0
  22. data/lib/sliday_backup/database/openldap.rb +95 -0
  23. data/lib/sliday_backup/database/postgresql.rb +133 -0
  24. data/lib/sliday_backup/database/redis.rb +179 -0
  25. data/lib/sliday_backup/database/riak.rb +82 -0
  26. data/lib/sliday_backup/database/sqlite.rb +57 -0
  27. data/lib/sliday_backup/encryptor/base.rb +29 -0
  28. data/lib/sliday_backup/encryptor/gpg.rb +747 -0
  29. data/lib/sliday_backup/encryptor/open_ssl.rb +77 -0
  30. data/lib/sliday_backup/errors.rb +58 -0
  31. data/lib/sliday_backup/logger.rb +199 -0
  32. data/lib/sliday_backup/logger/console.rb +51 -0
  33. data/lib/sliday_backup/logger/fog_adapter.rb +29 -0
  34. data/lib/sliday_backup/logger/logfile.rb +133 -0
  35. data/lib/sliday_backup/logger/syslog.rb +116 -0
  36. data/lib/sliday_backup/model.rb +479 -0
  37. data/lib/sliday_backup/notifier/base.rb +128 -0
  38. data/lib/sliday_backup/notifier/campfire.rb +63 -0
  39. data/lib/sliday_backup/notifier/command.rb +99 -0
  40. data/lib/sliday_backup/notifier/datadog.rb +107 -0
  41. data/lib/sliday_backup/notifier/flowdock.rb +103 -0
  42. data/lib/sliday_backup/notifier/hipchat.rb +112 -0
  43. data/lib/sliday_backup/notifier/http_post.rb +117 -0
  44. data/lib/sliday_backup/notifier/mail.rb +244 -0
  45. data/lib/sliday_backup/notifier/nagios.rb +69 -0
  46. data/lib/sliday_backup/notifier/pagerduty.rb +81 -0
  47. data/lib/sliday_backup/notifier/prowl.rb +68 -0
  48. data/lib/sliday_backup/notifier/pushover.rb +74 -0
  49. data/lib/sliday_backup/notifier/ses.rb +88 -0
  50. data/lib/sliday_backup/notifier/slack.rb +148 -0
  51. data/lib/sliday_backup/notifier/twitter.rb +58 -0
  52. data/lib/sliday_backup/notifier/zabbix.rb +63 -0
  53. data/lib/sliday_backup/package.rb +55 -0
  54. data/lib/sliday_backup/packager.rb +107 -0
  55. data/lib/sliday_backup/pipeline.rb +124 -0
  56. data/lib/sliday_backup/splitter.rb +76 -0
  57. data/lib/sliday_backup/storage/base.rb +69 -0
  58. data/lib/sliday_backup/storage/cloud_files.rb +158 -0
  59. data/lib/sliday_backup/storage/cycler.rb +75 -0
  60. data/lib/sliday_backup/storage/dropbox.rb +212 -0
  61. data/lib/sliday_backup/storage/ftp.rb +112 -0
  62. data/lib/sliday_backup/storage/local.rb +64 -0
  63. data/lib/sliday_backup/storage/qiniu.rb +65 -0
  64. data/lib/sliday_backup/storage/rsync.rb +248 -0
  65. data/lib/sliday_backup/storage/s3.rb +156 -0
  66. data/lib/sliday_backup/storage/scp.rb +67 -0
  67. data/lib/sliday_backup/storage/sftp.rb +82 -0
  68. data/lib/sliday_backup/storage/sliday_storage.rb +79 -0
  69. data/lib/sliday_backup/syncer/base.rb +70 -0
  70. data/lib/sliday_backup/syncer/cloud/base.rb +179 -0
  71. data/lib/sliday_backup/syncer/cloud/cloud_files.rb +83 -0
  72. data/lib/sliday_backup/syncer/cloud/local_file.rb +100 -0
  73. data/lib/sliday_backup/syncer/cloud/s3.rb +110 -0
  74. data/lib/sliday_backup/syncer/rsync/base.rb +54 -0
  75. data/lib/sliday_backup/syncer/rsync/local.rb +31 -0
  76. data/lib/sliday_backup/syncer/rsync/pull.rb +51 -0
  77. data/lib/sliday_backup/syncer/rsync/push.rb +205 -0
  78. data/lib/sliday_backup/template.rb +46 -0
  79. data/lib/sliday_backup/utilities.rb +224 -0
  80. data/lib/sliday_backup/version.rb +5 -0
  81. data/templates/cli/archive +28 -0
  82. data/templates/cli/compressor/bzip2 +4 -0
  83. data/templates/cli/compressor/custom +7 -0
  84. data/templates/cli/compressor/gzip +4 -0
  85. data/templates/cli/config +123 -0
  86. data/templates/cli/databases/mongodb +15 -0
  87. data/templates/cli/databases/mysql +18 -0
  88. data/templates/cli/databases/openldap +24 -0
  89. data/templates/cli/databases/postgresql +16 -0
  90. data/templates/cli/databases/redis +16 -0
  91. data/templates/cli/databases/riak +17 -0
  92. data/templates/cli/databases/sqlite +11 -0
  93. data/templates/cli/encryptor/gpg +27 -0
  94. data/templates/cli/encryptor/openssl +9 -0
  95. data/templates/cli/model +26 -0
  96. data/templates/cli/notifier/zabbix +15 -0
  97. data/templates/cli/notifiers/campfire +12 -0
  98. data/templates/cli/notifiers/command +32 -0
  99. data/templates/cli/notifiers/datadog +57 -0
  100. data/templates/cli/notifiers/flowdock +16 -0
  101. data/templates/cli/notifiers/hipchat +16 -0
  102. data/templates/cli/notifiers/http_post +32 -0
  103. data/templates/cli/notifiers/mail +24 -0
  104. data/templates/cli/notifiers/nagios +13 -0
  105. data/templates/cli/notifiers/pagerduty +12 -0
  106. data/templates/cli/notifiers/prowl +11 -0
  107. data/templates/cli/notifiers/pushover +11 -0
  108. data/templates/cli/notifiers/ses +15 -0
  109. data/templates/cli/notifiers/slack +22 -0
  110. data/templates/cli/notifiers/twitter +13 -0
  111. data/templates/cli/splitter +7 -0
  112. data/templates/cli/storages/cloud_files +11 -0
  113. data/templates/cli/storages/dropbox +20 -0
  114. data/templates/cli/storages/ftp +13 -0
  115. data/templates/cli/storages/local +8 -0
  116. data/templates/cli/storages/qiniu +12 -0
  117. data/templates/cli/storages/rsync +17 -0
  118. data/templates/cli/storages/s3 +16 -0
  119. data/templates/cli/storages/scp +15 -0
  120. data/templates/cli/storages/sftp +15 -0
  121. data/templates/cli/storages/sliday_storage +6 -0
  122. data/templates/cli/syncers/cloud_files +22 -0
  123. data/templates/cli/syncers/rsync_local +20 -0
  124. data/templates/cli/syncers/rsync_pull +28 -0
  125. data/templates/cli/syncers/rsync_push +28 -0
  126. data/templates/cli/syncers/s3 +27 -0
  127. data/templates/general/links +3 -0
  128. data/templates/general/version.erb +2 -0
  129. data/templates/notifier/mail/failure.erb +16 -0
  130. data/templates/notifier/mail/success.erb +16 -0
  131. data/templates/notifier/mail/warning.erb +16 -0
  132. data/templates/storage/dropbox/authorization_url.erb +6 -0
  133. data/templates/storage/dropbox/authorized.erb +4 -0
  134. data/templates/storage/dropbox/cache_file_written.erb +10 -0
  135. metadata +1079 -0
@@ -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 SlidayBackup'
13
+ flowdock.source = 'SlidayBackup'
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 SlidayBackup"
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 SlidayBackup'
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,11 @@
1
+ ##
2
+ # Prowl [Notifier]
3
+ #
4
+ notify_by Prowl do |prowl|
5
+ prowl.on_success = true
6
+ prowl.on_warning = true
7
+ prowl.on_failure = true
8
+
9
+ prowl.application = "my_application"
10
+ prowl.api_key = "my_api_key"
11
+ end
@@ -0,0 +1,11 @@
1
+ ##
2
+ # Pushover [Notifier]
3
+ #
4
+ notify_by Pushover do |push|
5
+ push.on_success = true
6
+ push.on_warning = true
7
+ push.on_failure = true
8
+
9
+ push.user = "USER_TOKEN"
10
+ push.token = "APP_TOKEN"
11
+ 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,7 @@
1
+ ##
2
+ # Split [Splitter]
3
+ #
4
+ # Split the backup file in to chunks of 250 megabytes
5
+ # if the backup file size exceeds 250 megabytes
6
+ #
7
+ split_into_chunks_of 250
@@ -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 ~/SlidayBackup, 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,8 @@
1
+ ##
2
+ # Local (Copy) [Storage]
3
+ #
4
+ store_with Local do |local|
5
+ local.path = "~/backups/"
6
+ local.keep = 5
7
+ # local.keep = Time.now - 2592000 # Remove all backups older than 1 month.
8
+ end
@@ -0,0 +1,12 @@
1
+ ##
2
+ # Qiniu [Storage]
3
+ #
4
+ store_with Qiniu do |qiniu|
5
+ # Qiniu Credentials
6
+ qiniu.access_key = "my_access_key"
7
+ qiniu.secret_key = "my_secret_key"
8
+
9
+ qiniu.bucket = "bucket-name"
10
+ qiniu.keep = 5
11
+ qiniu.path = "path/to/backups"
12
+ 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,6 @@
1
+ ##
2
+ # SlidayStorage
3
+ #
4
+ store_with SlidayStorage do |s|
5
+ s.api_key = "PROJECT_API_KEY"
6
+ 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
@@ -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