backup-wakiki 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/.document +5 -0
  2. data/.gitignore +5 -0
  3. data/CHANGELOG +77 -0
  4. data/LICENSE +9 -0
  5. data/README.textile +175 -0
  6. data/Rakefile +65 -0
  7. data/VERSION +1 -0
  8. data/backup-2.3.1.gem +0 -0
  9. data/backup-wakiki.gemspec +113 -0
  10. data/backup.gemspec +111 -0
  11. data/bin/backup +124 -0
  12. data/generators/backup/backup_generator.rb +72 -0
  13. data/generators/backup/templates/config/backup.rb +202 -0
  14. data/generators/backup/templates/migrations/create_backup_tables.rb +18 -0
  15. data/generators/backup/templates/tasks/backup.rake +71 -0
  16. data/generators/backup_update/backup_update_generator.rb +50 -0
  17. data/generators/backup_update/templates/migrations/update_backup_tables.rb +27 -0
  18. data/lib/backup.rb +112 -0
  19. data/lib/backup/adapters/archive.rb +34 -0
  20. data/lib/backup/adapters/base.rb +113 -0
  21. data/lib/backup/adapters/custom.rb +41 -0
  22. data/lib/backup/adapters/mysql.rb +60 -0
  23. data/lib/backup/adapters/postgresql.rb +56 -0
  24. data/lib/backup/adapters/sqlite.rb +25 -0
  25. data/lib/backup/command_helper.rb +11 -0
  26. data/lib/backup/configuration/adapter.rb +21 -0
  27. data/lib/backup/configuration/adapter_options.rb +8 -0
  28. data/lib/backup/configuration/attributes.rb +19 -0
  29. data/lib/backup/configuration/base.rb +55 -0
  30. data/lib/backup/configuration/helpers.rb +24 -0
  31. data/lib/backup/configuration/mail.rb +20 -0
  32. data/lib/backup/configuration/smtp.rb +8 -0
  33. data/lib/backup/configuration/storage.rb +8 -0
  34. data/lib/backup/connection/s3.rb +87 -0
  35. data/lib/backup/environment/base.rb +12 -0
  36. data/lib/backup/environment/rails.rb +17 -0
  37. data/lib/backup/environment/unix.rb +94 -0
  38. data/lib/backup/mail/base.rb +96 -0
  39. data/lib/backup/mail/mail.txt +7 -0
  40. data/lib/backup/record/base.rb +65 -0
  41. data/lib/backup/record/ftp.rb +39 -0
  42. data/lib/backup/record/local.rb +26 -0
  43. data/lib/backup/record/s3.rb +26 -0
  44. data/lib/backup/record/scp.rb +33 -0
  45. data/lib/backup/record/sftp.rb +38 -0
  46. data/lib/backup/storage/ftp.rb +38 -0
  47. data/lib/backup/storage/local.rb +24 -0
  48. data/lib/backup/storage/s3.rb +16 -0
  49. data/lib/backup/storage/scp.rb +30 -0
  50. data/lib/backup/storage/sftp.rb +31 -0
  51. data/setup/backup.rb +202 -0
  52. data/setup/backup.sqlite3 +0 -0
  53. data/spec/configuration/attributes_spec.rb +35 -0
  54. metadata +183 -0
@@ -0,0 +1,5 @@
1
+ README.textile
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
@@ -0,0 +1,77 @@
1
+ === 2.?.? ====================================
2
+
3
+ - Added Storage Method: Local
4
+ - Added Adapter: SQLite
5
+ - exclude option added for Archive Adapter
6
+ - Internal cleanup
7
+ - Will try to automatically determine the path to mysqldump and pg_dump utilities
8
+ - Added spec/tests
9
+
10
+ MINOR UPDATE
11
+ === 2.3.1 ======================================
12
+
13
+ - Added Feature: Email notifications
14
+
15
+
16
+ PATCH
17
+ === 2.3.0.3 ====================================
18
+
19
+ - Small bug was patched. Error would occur when a list of triggers should be shown
20
+
21
+
22
+ BIG UPDATE
23
+ === 2.3.0 ====================================
24
+
25
+ - Backup became independent of Ruby on Rails
26
+ - Backup now supports multiple environments: Rails and Unix
27
+ - Backup is now executable through the command-line when using the Unix environment
28
+
29
+
30
+ SMALL FEATURE UPDATE
31
+ === 2.2.1 ====================================
32
+
33
+ - use_ssl option added for S3 Storage Method
34
+ - additional_options option added for MySQL and PostgreSQL Adapters
35
+
36
+
37
+ PRETTY BIG UPDATE
38
+ === 2.2.0 ====================================
39
+
40
+ - Added Storage Methods: FTP and SFTP
41
+ - Added Adapters: PostgreSQL and Custom
42
+ - Added more options to the MySQL Adapter
43
+ - A couple of bug fixes
44
+
45
+
46
+ MINOR UPDATE
47
+ === 2.1.2 ====================================
48
+
49
+ - The backup generator will now provide you with a step-by-step guide to getting up and running
50
+ - Updated the generator itself
51
+ - Removed SQLite3 dependencies
52
+
53
+
54
+ 2 TABLES 2 1
55
+ === 2.1.1 ====================================
56
+
57
+ - Backup will from now on only utilize one table, instead of one for each storage method
58
+ - Still backwards compatible to 2.1.0
59
+
60
+
61
+ FIXED A CRUCIAL BUG
62
+ === 2.1.0 ====================================
63
+
64
+ - Problem with Backup::Record. It tried to connect to the SQLite3 database.
65
+
66
+
67
+ MAJOR RELEASE
68
+ === 2.0.0 ====================================
69
+
70
+ - Should be a lot more backwards compatible with every update I do.
71
+ - Does not depend on the separate local SQLite3 file any longer.
72
+ - Will provide a db migration file for your Rails Application to store backup record data in.
73
+ - Does not use YAML files to do configuration any longer.
74
+ - Uses a SINGLE ruby file for "all" configuration (config/backup.rb) using elegant block notations!
75
+ - Uses a SINGLE rake task to handle the initialization of any backup setting.
76
+ - Can now configure an unlimited amount of customizable backup settings and run them each "individually"!
77
+ - HIGHLY IMPROVED USABILITY!
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) 2009 Michael van Rooijen - Final Creation (http://final-creation.com)
2
+
3
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
7
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
8
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
9
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,175 @@
1
+ h1. Backup
2
+
3
+ h2. A Backup Ruby Gem
4
+
5
+ Backup is a Ruby Gem written for Unix and Rails environments. It can be used both with and without the Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases such as MySQL/PostgreSQL and Files/Folders. All backups can be transferred to Amazon S3 or any remote server you have access to, using either SCP, SFTP or regular FTP. Backup handles Compression, Archiving, Encryption, Backup Cleaning (Cycling) and supports Email Notifications.
6
+
7
+ h2. Authors/Maintainers
8
+
9
+ * "Meskyanichi - Michael van Rooijen":http://github.com/meskyanichi
10
+ * "Fernandoluizao - Fernando Migliorini Luizão":http://github.com/fernandoluizao
11
+
12
+
13
+ h2. Backup's Current Capabilities
14
+
15
+ h3. Storage Methods
16
+
17
+ * Amazon S3
18
+ * Remote Server (Available Protocols: SCP, SFTP, FTP)
19
+ * Local server (Example Locations: Another Hard Drive, Network path) *(coming in the next gem release)*
20
+
21
+ h3. Adapters
22
+
23
+ * MySQL
24
+ * SQLite *(in the next gem release)*
25
+ * PostgreSQL
26
+ * Archive (Any files and/or folders)
27
+ * Custom (Anything you can produce using the command line)
28
+
29
+ h3. Archiving
30
+
31
+ Handles archiving for the *Archive* and *Custom* adapters.
32
+
33
+ h3. Encryption
34
+
35
+ Handles encryption of *all* backups for *any* adapter.
36
+ To decrypt a "Backup encrypted file" you can use Backup's built-in utility command:
37
+
38
+ bc. sudo backup --decrypt /path/to/encrypted/file.enc
39
+
40
+ h3. Backup Cleaning
41
+
42
+ With Backup you can very easily specify how many backups you would like to have stored (per backup procedure!) on your Amazon S3, Remote or Local server. When the limit you specify gets exceeded, the oldest backup will automatically be cleaned up.
43
+
44
+ h3. Email Notifications
45
+
46
+ You will be able to specify whether you would like to be notified by email when a backup successfully been stored.
47
+ Simply fill in the email configuration block and set "notify" to true inside the backup procedure you would like to be notified of.
48
+
49
+ h3. Quick Example of a Single Backup Setting/Procedure inside the Backup Configuration File
50
+
51
+ bc. backup 'mysql-backup-s3' do
52
+ adapter :mysql do
53
+ user 'user'
54
+ password 'password'
55
+ database 'database'
56
+ end
57
+ storage :s3 do
58
+ access_key_id 'access_key_id'
59
+ secret_access_key 'secret_access_key'
60
+ bucket '/bucket/backups/mysql/'
61
+ use_ssl true
62
+ end
63
+ keep_backups 25
64
+ encrypt_with_password 'my_password'
65
+ notify true
66
+ end
67
+
68
+ Everything above should be pretty straightforward, so now, using the "trigger" we specified between
69
+ the *backup* and *do* you can execute this backup procedure like so:
70
+
71
+ *Rails Environment*
72
+
73
+ bc. rake backup:run trigger=mysql-backup-s3
74
+
75
+ *Unix Environment*
76
+
77
+ bc. sudo backup --run mysql-backup-s3
78
+
79
+ That's it. This was a simple example of how it works.
80
+
81
+
82
+ h2. Interested in trying out Backup?
83
+
84
+
85
+ h3. Getting started with Backup for the *Unix Environment*
86
+
87
+ "http://wiki.github.com/meskyanichi/backup/getting-started-unix":http://wiki.github.com/meskyanichi/backup/getting-started-unix
88
+
89
+
90
+ h3. Getting started with Backup for the *Rails Environment*
91
+
92
+ "http://wiki.github.com/meskyanichi/backup/getting-started-ruby-on-rails":http://wiki.github.com/meskyanichi/backup/getting-started-ruby-on-rails
93
+
94
+
95
+ h3. Production Mode *RAILS_ENV*
96
+
97
+ "http://wiki.github.com/meskyanichi/backup/production-mode":http://wiki.github.com/meskyanichi/backup/production-mode
98
+
99
+
100
+ h3. Encrypting and Decrypting
101
+
102
+ "http://wiki.github.com/meskyanichi/backup/encrypting-and-decrypting":http://wiki.github.com/meskyanichi/backup/encrypting-and-decrypting
103
+
104
+
105
+ h3. Backup Configuration File (All Adapters, Storage Methods, Mail Settings and Options)
106
+
107
+ "http://wiki.github.com/meskyanichi/backup/configuration-file":http://wiki.github.com/meskyanichi/backup/configuration-file
108
+
109
+
110
+ h3. Unix Utility Commands and Rails Rake Tasks
111
+
112
+ "http://wiki.github.com/meskyanichi/backup/utility-commands":http://wiki.github.com/meskyanichi/backup/utility-commands
113
+
114
+ "http://wiki.github.com/meskyanichi/backup/rake-tasks":http://wiki.github.com/meskyanichi/backup/rake-tasks
115
+
116
+
117
+ h3. Automatic Backups
118
+
119
+ "http://wiki.github.com/meskyanichi/backup/automatic-backups":http://wiki.github.com/meskyanichi/backup/automatic-backups
120
+
121
+
122
+ h3. Capistrano Recipes
123
+
124
+ "http://wiki.github.com/meskyanichi/backup/capistrano-recipes":http://wiki.github.com/meskyanichi/backup/capistrano-recipes
125
+
126
+
127
+ h3. Capistrano, Whenever!
128
+
129
+ "http://wiki.github.com/meskyanichi/backup/capistrano-whenever":http://wiki.github.com/meskyanichi/backup/capistrano-whenever
130
+
131
+
132
+ h3. Understanding "The Backup Database"
133
+
134
+ "http://wiki.github.com/meskyanichi/backup/the-backup-database":http://wiki.github.com/meskyanichi/backup/the-backup-database
135
+
136
+
137
+ h3. Trouble Shooting
138
+
139
+ "http://wiki.github.com/meskyanichi/backup/troubleshooting":http://wiki.github.com/meskyanichi/backup/troubleshooting
140
+
141
+
142
+ h3. Requirements
143
+
144
+ "http://wiki.github.com/meskyanichi/backup/requirements":http://wiki.github.com/meskyanichi/backup/requirements
145
+
146
+
147
+ h3. Resources
148
+
149
+ "http://wiki.github.com/meskyanichi/backup/resources":http://wiki.github.com/meskyanichi/backup/resources
150
+
151
+
152
+ h3. Requests
153
+
154
+ If anyone has any requests, please send us a message or post it on the issues page!
155
+
156
+
157
+ h3. Suggestions?
158
+
159
+ Send us a message! Fork the project!
160
+
161
+
162
+ h3. Found a Bug?
163
+
164
+ "http://github.com/meskyanichi/backup/issues":http://github.com/meskyanichi/backup/issues
165
+
166
+
167
+ h3. Contributors
168
+
169
+ List of people that forked and added stuff!
170
+
171
+ * "dtrueman":http://github.com/dtrueman
172
+
173
+
174
+
175
+ _Michael van Rooijen | Final Creation. ("http://final-creation.com":http://final-creation.com)_
@@ -0,0 +1,65 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "backup-wakiki"
8
+ gem.summary = %Q{Backup is a Ruby Gem that simplifies making backups for databases, files and folders.}
9
+ gem.description = %Q{
10
+ Backup is a Ruby Gem written for Unix and Rails environments. It can be used both with and without the
11
+ Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases such as
12
+ MySQL/PostgreSQL and Files/Folders. All backups can be transferred to Amazon S3 or any remote server you
13
+ have access to, using either SCP, SFTP or regular FTP. Backup handles Compression, Archiving, Encryption,
14
+ Backup Cleaning (Cycling) and supports Email Notifications.
15
+ }
16
+
17
+ gem.email = "meskyanichi@gmail.com"
18
+ gem.homepage = "http://final-creation.com/open-source"
19
+ gem.authors = ["Michael van Rooijen", "Fernando Migliorini Luizão"]
20
+ gem.add_dependency "activerecord", ">= 2.3.5"
21
+ gem.add_dependency "sqlite3-ruby", ">= 1.2.5"
22
+ gem.add_dependency "hirb", ">= 0.2.9"
23
+ gem.add_dependency "pony", ">= 0.5"
24
+
25
+ end
26
+ rescue LoadError
27
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
28
+ end
29
+
30
+ require 'spec/rake/spectask'
31
+ Spec::Rake::SpecTask.new do |t|
32
+ t.spec_files = FileList['spec/**/*_spec.rb']
33
+ t.spec_opts = %w(-fp --color)
34
+ end
35
+
36
+ begin
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/*_test.rb'
41
+ test.verbose = true
42
+ end
43
+ rescue LoadError
44
+ task :rcov do
45
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
46
+ end
47
+ end
48
+
49
+ task :test => :check_dependencies
50
+
51
+ task :default => :spec
52
+
53
+ require 'rake/rdoctask'
54
+ Rake::RDocTask.new do |rdoc|
55
+ if File.exist?('VERSION')
56
+ version = File.read('VERSION')
57
+ else
58
+ version = ""
59
+ end
60
+
61
+ rdoc.rdoc_dir = 'rdoc'
62
+ rdoc.title = "backup #{version}"
63
+ rdoc.rdoc_files.include('README*')
64
+ rdoc.rdoc_files.include('lib/**/*.rb')
65
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.4.1
Binary file
@@ -0,0 +1,113 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{backup-wakiki}
8
+ s.version = "2.4.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Michael van Rooijen", "Fernando Migliorini Luiz\303\243o"]
12
+ s.date = %q{2010-06-25}
13
+ s.default_executable = %q{backup}
14
+ s.description = %q{
15
+ Backup is a Ruby Gem written for Unix and Rails environments. It can be used both with and without the
16
+ Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases such as
17
+ MySQL/PostgreSQL and Files/Folders. All backups can be transferred to Amazon S3 or any remote server you
18
+ have access to, using either SCP, SFTP or regular FTP. Backup handles Compression, Archiving, Encryption,
19
+ Backup Cleaning (Cycling) and supports Email Notifications.
20
+ }
21
+ s.email = %q{meskyanichi@gmail.com}
22
+ s.executables = ["backup"]
23
+ s.extra_rdoc_files = [
24
+ "LICENSE",
25
+ "README.textile"
26
+ ]
27
+ s.files = [
28
+ ".document",
29
+ ".gitignore",
30
+ "CHANGELOG",
31
+ "LICENSE",
32
+ "README.textile",
33
+ "Rakefile",
34
+ "VERSION",
35
+ "backup-2.3.1.gem",
36
+ "backup-wakiki.gemspec",
37
+ "backup.gemspec",
38
+ "bin/backup",
39
+ "generators/backup/backup_generator.rb",
40
+ "generators/backup/templates/config/backup.rb",
41
+ "generators/backup/templates/migrations/create_backup_tables.rb",
42
+ "generators/backup/templates/tasks/backup.rake",
43
+ "generators/backup_update/backup_update_generator.rb",
44
+ "generators/backup_update/templates/migrations/update_backup_tables.rb",
45
+ "lib/backup.rb",
46
+ "lib/backup/adapters/archive.rb",
47
+ "lib/backup/adapters/base.rb",
48
+ "lib/backup/adapters/custom.rb",
49
+ "lib/backup/adapters/mysql.rb",
50
+ "lib/backup/adapters/postgresql.rb",
51
+ "lib/backup/adapters/sqlite.rb",
52
+ "lib/backup/command_helper.rb",
53
+ "lib/backup/configuration/adapter.rb",
54
+ "lib/backup/configuration/adapter_options.rb",
55
+ "lib/backup/configuration/attributes.rb",
56
+ "lib/backup/configuration/base.rb",
57
+ "lib/backup/configuration/helpers.rb",
58
+ "lib/backup/configuration/mail.rb",
59
+ "lib/backup/configuration/smtp.rb",
60
+ "lib/backup/configuration/storage.rb",
61
+ "lib/backup/connection/s3.rb",
62
+ "lib/backup/environment/base.rb",
63
+ "lib/backup/environment/rails.rb",
64
+ "lib/backup/environment/unix.rb",
65
+ "lib/backup/mail/base.rb",
66
+ "lib/backup/mail/mail.txt",
67
+ "lib/backup/record/base.rb",
68
+ "lib/backup/record/ftp.rb",
69
+ "lib/backup/record/local.rb",
70
+ "lib/backup/record/s3.rb",
71
+ "lib/backup/record/scp.rb",
72
+ "lib/backup/record/sftp.rb",
73
+ "lib/backup/storage/ftp.rb",
74
+ "lib/backup/storage/local.rb",
75
+ "lib/backup/storage/s3.rb",
76
+ "lib/backup/storage/scp.rb",
77
+ "lib/backup/storage/sftp.rb",
78
+ "setup/backup.rb",
79
+ "setup/backup.sqlite3",
80
+ "spec/configuration/attributes_spec.rb"
81
+ ]
82
+ s.homepage = %q{http://final-creation.com/open-source}
83
+ s.rdoc_options = ["--charset=UTF-8"]
84
+ s.require_paths = ["lib"]
85
+ s.rubygems_version = %q{1.3.7}
86
+ s.summary = %q{Backup is a Ruby Gem that simplifies making backups for databases, files and folders.}
87
+ s.test_files = [
88
+ "spec/configuration/attributes_spec.rb"
89
+ ]
90
+
91
+ if s.respond_to? :specification_version then
92
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
93
+ s.specification_version = 3
94
+
95
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
96
+ s.add_runtime_dependency(%q<activerecord>, [">= 2.3.5"])
97
+ s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
98
+ s.add_runtime_dependency(%q<hirb>, [">= 0.2.9"])
99
+ s.add_runtime_dependency(%q<pony>, [">= 0.5"])
100
+ else
101
+ s.add_dependency(%q<activerecord>, [">= 2.3.5"])
102
+ s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
103
+ s.add_dependency(%q<hirb>, [">= 0.2.9"])
104
+ s.add_dependency(%q<pony>, [">= 0.5"])
105
+ end
106
+ else
107
+ s.add_dependency(%q<activerecord>, [">= 2.3.5"])
108
+ s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
109
+ s.add_dependency(%q<hirb>, [">= 0.2.9"])
110
+ s.add_dependency(%q<pony>, [">= 0.5"])
111
+ end
112
+ end
113
+