bostonlogic-safe 0.3.0

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 (41) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +227 -0
  3. data/Rakefile +54 -0
  4. data/VERSION.yml +4 -0
  5. data/bin/astrails-safe +53 -0
  6. data/examples/example_helper.rb +19 -0
  7. data/examples/integration/archive_integration_example.rb +86 -0
  8. data/examples/integration/cleanup_example.rb +62 -0
  9. data/examples/unit/archive_example.rb +67 -0
  10. data/examples/unit/config_example.rb +184 -0
  11. data/examples/unit/gpg_example.rb +138 -0
  12. data/examples/unit/gzip_example.rb +64 -0
  13. data/examples/unit/local_example.rb +110 -0
  14. data/examples/unit/mysqldump_example.rb +83 -0
  15. data/examples/unit/pgdump_example.rb +45 -0
  16. data/examples/unit/rcloud_example.rb +110 -0
  17. data/examples/unit/s3_example.rb +112 -0
  18. data/examples/unit/svndump_example.rb +39 -0
  19. data/lib/astrails/safe.rb +71 -0
  20. data/lib/astrails/safe/archive.rb +24 -0
  21. data/lib/astrails/safe/backup.rb +20 -0
  22. data/lib/astrails/safe/config/builder.rb +62 -0
  23. data/lib/astrails/safe/config/node.rb +66 -0
  24. data/lib/astrails/safe/gpg.rb +45 -0
  25. data/lib/astrails/safe/gzip.rb +25 -0
  26. data/lib/astrails/safe/local.rb +48 -0
  27. data/lib/astrails/safe/mysqldump.rb +31 -0
  28. data/lib/astrails/safe/notification.rb +66 -0
  29. data/lib/astrails/safe/pgdump.rb +36 -0
  30. data/lib/astrails/safe/pipe.rb +13 -0
  31. data/lib/astrails/safe/rcloud.rb +73 -0
  32. data/lib/astrails/safe/s3.rb +68 -0
  33. data/lib/astrails/safe/sftp.rb +79 -0
  34. data/lib/astrails/safe/sink.rb +33 -0
  35. data/lib/astrails/safe/source.rb +46 -0
  36. data/lib/astrails/safe/stream.rb +19 -0
  37. data/lib/astrails/safe/svndump.rb +13 -0
  38. data/lib/astrails/safe/tmp_file.rb +48 -0
  39. data/lib/extensions/mktmpdir.rb +45 -0
  40. data/templates/script.rb +155 -0
  41. metadata +135 -0
@@ -0,0 +1,155 @@
1
+ safe do
2
+
3
+ # backup file path (not including filename)
4
+ # supported substitutions:
5
+ # :kind -> backup 'engine' kind, e.g. "mysqldump" or "archive"
6
+ # :id -> backup 'id', e.g. "blog", "production", etc.
7
+ # :timestamp -> current run timestamp (same for all the backups in the same 'run')
8
+ # you can set separate :path for all backups (or once globally here)
9
+ local do
10
+ path "/backup/:kind"
11
+ end
12
+
13
+ ## uncomment to enable uploads to Amazon S3
14
+ ## Amazon S3 auth (optional)
15
+ ## don't forget to add :s3 to the 'store' list
16
+ # s3 do
17
+ # key YOUR_S3_KEY
18
+ # secret YOUR_S3_SECRET
19
+ # bucket S3_BUCKET
20
+ # # path for uploads to S3. supports same substitution like :local/:path
21
+ # path ":kind/" # this is default
22
+ # end
23
+
24
+ ## alternative style:
25
+ # s3 :key => YOUR_S3_KEY, :secret => YOUR_S3_SECRET, :bucket => S3_BUCKET, :path => ":kind/"
26
+
27
+ ## uncomment to enable uploads to Rackspace Cloudfiles
28
+ ## don't forget to add :rcloud to the 'store' list
29
+ # rcloud do
30
+ # username YOUR_RCLOUD_USERNAME
31
+ # api_key YOUR_RCLOUD_API_KEY
32
+ # container RCLOUD_BUCKET
33
+ # # path for uploads to Rackspace Cloudfiles. supports same substitution like :local/:path
34
+ # path ":kind/" # unless specified defaults to the local :path if available, then ":kind/"
35
+ # end
36
+
37
+ ## uncomment to enable uploads via SFTP
38
+ # sftp do
39
+ # host "YOUR_REMOTE_HOSTNAME"
40
+ # user "YOUR_REMOTE_USERNAME"
41
+ # password "YOUR_REMOTE_PASSWORD"
42
+ # path ":kind/:id" # this is the default
43
+ # end
44
+
45
+ ## uncomment to enable GPG encryption.
46
+ ## Note: you can use public 'key' or symmetric password but not both!
47
+ # gpg do
48
+ # # key "backup@astrails.com"
49
+ # password "astrails"
50
+ # end
51
+
52
+ ## uncomment to enable backup rotation. keep only given number of latest
53
+ ## backups. remove the rest
54
+ # keep do
55
+ # local 4 # keep 4 local backups
56
+ # s3 20 # keep 20 S3 backups
57
+ # rcloud 5 # keep 5 Rackspace Cloudfile backups
58
+ # end
59
+
60
+ ## uncomment to enable email notification for backup failures
61
+ ## all options are required
62
+ # notification do
63
+ # subject "safe backup failure"
64
+ # host "mail.example.com"
65
+ # domain "example.com"
66
+ # username "safe@example.com"
67
+ # password "example"
68
+ # authentication :login
69
+ # port 25
70
+ # from "example@example.com"
71
+ # recipients "developement_staff@example.com"
72
+ # end
73
+
74
+ # backup mysql databases with mysqldump
75
+ mysqldump do
76
+ # you can override any setting from parent in a child:
77
+ options "-ceKq --single-transaction --create-options"
78
+
79
+ user "astrails"
80
+ password ""
81
+ # host "localhost"
82
+ # port 3306
83
+ socket "/var/run/mysqld/mysqld.sock"
84
+
85
+ # database is a 'collection' element. it must have a hash or block parameter
86
+ # it will be 'collected' in a 'databases', with database id (1st arg) used as hash key
87
+ # the following code will create mysqldump/databases/blog and mysqldump/databases/mysql ocnfiguration 'nodes'
88
+
89
+ # backup database with default values
90
+ # database :blog
91
+
92
+ # backup overriding some values
93
+ # database :production do
94
+ # # you can override 'partially'
95
+ # keep :local => 3
96
+ # # keep/local is 3, and keep/s3 is 20 (from parent)
97
+
98
+ # # local override for gpg password
99
+ # gpg do
100
+ # password "custom-production-pass"
101
+ # end
102
+
103
+ # skip_tables [:logger_exceptions, :request_logs] # skip those tables during backup
104
+ # end
105
+
106
+ end
107
+
108
+ # # uncomment to enable
109
+ # # backup PostgreSQL databases with pg_dump
110
+ # pgdump do
111
+ # option "-i -x -O"
112
+ #
113
+ # user "markmansour"
114
+ # # password "" - leave this out if you have ident setup
115
+ #
116
+ # # database is a 'collection' element. it must have a hash or block parameter
117
+ # # it will be 'collected' in a 'databases', with database id (1st arg) used as hash key
118
+ # database :blog
119
+ # database :production
120
+ # end
121
+
122
+ tar do
123
+ # 'archive' is a collection item, just like 'database'
124
+ # archive "git-repositories" do
125
+ # # files and directories to backup
126
+ # files "/home/git/repositories"
127
+ # end
128
+
129
+ # archive "etc-files" do
130
+ # files "/etc"
131
+ # # exlude those files/directories
132
+ # exclude "/etc/puppet/other"
133
+ # end
134
+
135
+ # archive "dot-configs" do
136
+ # files "/home/*/.[^.]*"
137
+ # end
138
+
139
+ # archive "blog" do
140
+ # files "/var/www/blog.astrails.com/"
141
+ # # specify multiple files/directories as array
142
+ # exclude ["/var/www/blog.astrails.com/log", "/var/www/blog.astrails.com/tmp"]
143
+ # end
144
+
145
+ # archive "site" do
146
+ # files "/var/www/astrails.com/"
147
+ # exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"]
148
+ # end
149
+
150
+ # archive :misc do
151
+ # files [ "/backup/*.rb" ]
152
+ # end
153
+ end
154
+
155
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bostonlogic-safe
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Astrails Ltd.
8
+ - Mark Mansour
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-09-14 00:00:00 -07:00
14
+ default_executable: astrails-safe
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: aws-s3
18
+ type: :runtime
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: net-sftp
28
+ type: :runtime
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ version:
36
+ - !ruby/object:Gem::Dependency
37
+ name: rackspace-cloudfiles
38
+ type: :runtime
39
+ version_requirement:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ description: Simple tool to backup databases (MySQL and PostgreSQL) and filesystem locally or to Amazon S3 or Rackspace Cloudfiles (with optional encryption)
47
+ email: we@astrails.com
48
+ executables:
49
+ - astrails-safe
50
+ extensions: []
51
+
52
+ extra_rdoc_files:
53
+ - LICENSE
54
+ - README.markdown
55
+ files:
56
+ - LICENSE
57
+ - README.markdown
58
+ - Rakefile
59
+ - VERSION.yml
60
+ - bin/astrails-safe
61
+ - examples/example_helper.rb
62
+ - examples/integration/archive_integration_example.rb
63
+ - examples/integration/cleanup_example.rb
64
+ - examples/unit/archive_example.rb
65
+ - examples/unit/config_example.rb
66
+ - examples/unit/gpg_example.rb
67
+ - examples/unit/gzip_example.rb
68
+ - examples/unit/local_example.rb
69
+ - examples/unit/mysqldump_example.rb
70
+ - examples/unit/pgdump_example.rb
71
+ - examples/unit/rcloud_example.rb
72
+ - examples/unit/s3_example.rb
73
+ - examples/unit/svndump_example.rb
74
+ - lib/astrails/safe.rb
75
+ - lib/astrails/safe/archive.rb
76
+ - lib/astrails/safe/backup.rb
77
+ - lib/astrails/safe/config/builder.rb
78
+ - lib/astrails/safe/config/node.rb
79
+ - lib/astrails/safe/gpg.rb
80
+ - lib/astrails/safe/gzip.rb
81
+ - lib/astrails/safe/local.rb
82
+ - lib/astrails/safe/mysqldump.rb
83
+ - lib/astrails/safe/notification.rb
84
+ - lib/astrails/safe/pgdump.rb
85
+ - lib/astrails/safe/pipe.rb
86
+ - lib/astrails/safe/rcloud.rb
87
+ - lib/astrails/safe/s3.rb
88
+ - lib/astrails/safe/sftp.rb
89
+ - lib/astrails/safe/sink.rb
90
+ - lib/astrails/safe/source.rb
91
+ - lib/astrails/safe/stream.rb
92
+ - lib/astrails/safe/svndump.rb
93
+ - lib/astrails/safe/tmp_file.rb
94
+ - lib/extensions/mktmpdir.rb
95
+ - templates/script.rb
96
+ has_rdoc: false
97
+ homepage: http://github.com/astrails/safe
98
+ post_install_message:
99
+ rdoc_options:
100
+ - --charset=UTF-8
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "0"
108
+ version:
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: "0"
114
+ version:
115
+ requirements: []
116
+
117
+ rubyforge_project:
118
+ rubygems_version: 1.2.0
119
+ signing_key:
120
+ specification_version: 3
121
+ summary: Backup filesystem and databases (MySQL and PostgreSQL) to Amazon S3 or Rackspace Cloudfiles (with encryption)
122
+ test_files:
123
+ - examples/integration/archive_integration_example.rb
124
+ - examples/integration/cleanup_example.rb
125
+ - examples/unit/local_example.rb
126
+ - examples/unit/config_example.rb
127
+ - examples/unit/gzip_example.rb
128
+ - examples/unit/rcloud_example.rb
129
+ - examples/unit/s3_example.rb
130
+ - examples/unit/archive_example.rb
131
+ - examples/unit/pgdump_example.rb
132
+ - examples/unit/svndump_example.rb
133
+ - examples/unit/mysqldump_example.rb
134
+ - examples/unit/gpg_example.rb
135
+ - examples/example_helper.rb