webbynode-safe 0.2.5

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 (40) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +211 -0
  3. data/Rakefile +53 -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/s3_example.rb +112 -0
  17. data/examples/unit/svndump_example.rb +39 -0
  18. data/lib/astrails/safe.rb +62 -0
  19. data/lib/astrails/safe/archive.rb +24 -0
  20. data/lib/astrails/safe/backup.rb +20 -0
  21. data/lib/astrails/safe/config/builder.rb +60 -0
  22. data/lib/astrails/safe/config/node.rb +66 -0
  23. data/lib/astrails/safe/gpg.rb +45 -0
  24. data/lib/astrails/safe/gzip.rb +25 -0
  25. data/lib/astrails/safe/local.rb +46 -0
  26. data/lib/astrails/safe/mongodbdump.rb +25 -0
  27. data/lib/astrails/safe/multi.rb +134 -0
  28. data/lib/astrails/safe/mysqldump.rb +31 -0
  29. data/lib/astrails/safe/pgdump.rb +36 -0
  30. data/lib/astrails/safe/pipe.rb +13 -0
  31. data/lib/astrails/safe/s3.rb +68 -0
  32. data/lib/astrails/safe/sftp.rb +79 -0
  33. data/lib/astrails/safe/sink.rb +37 -0
  34. data/lib/astrails/safe/source.rb +46 -0
  35. data/lib/astrails/safe/stream.rb +19 -0
  36. data/lib/astrails/safe/svndump.rb +13 -0
  37. data/lib/astrails/safe/tmp_file.rb +48 -0
  38. data/lib/extensions/mktmpdir.rb +45 -0
  39. data/templates/script.rb +130 -0
  40. metadata +126 -0
@@ -0,0 +1,130 @@
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 via SFTP
28
+ # sftp do
29
+ # host "YOUR_REMOTE_HOSTNAME"
30
+ # user "YOUR_REMOTE_USERNAME"
31
+ # password "YOUR_REMOTE_PASSWORD"
32
+ # path ":kind/:id" # this is the default
33
+ # end
34
+
35
+ ## uncomment to enable GPG encryption.
36
+ ## Note: you can use public 'key' or symmetric password but not both!
37
+ # gpg do
38
+ # # key "backup@astrails.com"
39
+ # password "astrails"
40
+ # end
41
+
42
+ ## uncomment to enable backup rotation. keep only given number of latest
43
+ ## backups. remove the rest
44
+ # keep do
45
+ # local 4 # keep 4 local backups
46
+ # s3 20 # keep 20 S3 backups
47
+ # end
48
+
49
+ # backup mysql databases with mysqldump
50
+ mysqldump do
51
+ # you can override any setting from parent in a child:
52
+ options "-ceKq --single-transaction --create-options"
53
+
54
+ user "astrails"
55
+ password ""
56
+ # host "localhost"
57
+ # port 3306
58
+ socket "/var/run/mysqld/mysqld.sock"
59
+
60
+ # database is a 'collection' element. it must have a hash or block parameter
61
+ # it will be 'collected' in a 'databases', with database id (1st arg) used as hash key
62
+ # the following code will create mysqldump/databases/blog and mysqldump/databases/mysql ocnfiguration 'nodes'
63
+
64
+ # backup database with default values
65
+ # database :blog
66
+
67
+ # backup overriding some values
68
+ # database :production do
69
+ # # you can override 'partially'
70
+ # keep :local => 3
71
+ # # keep/local is 3, and keep/s3 is 20 (from parent)
72
+
73
+ # # local override for gpg password
74
+ # gpg do
75
+ # password "custom-production-pass"
76
+ # end
77
+
78
+ # skip_tables [:logger_exceptions, :request_logs] # skip those tables during backup
79
+ # end
80
+
81
+ end
82
+
83
+ # # uncomment to enable
84
+ # # backup PostgreSQL databases with pg_dump
85
+ # pgdump do
86
+ # option "-i -x -O"
87
+ #
88
+ # user "markmansour"
89
+ # # password "" - leave this out if you have ident setup
90
+ #
91
+ # # database is a 'collection' element. it must have a hash or block parameter
92
+ # # it will be 'collected' in a 'databases', with database id (1st arg) used as hash key
93
+ # database :blog
94
+ # database :production
95
+ # end
96
+
97
+ tar do
98
+ # 'archive' is a collection item, just like 'database'
99
+ # archive "git-repositories" do
100
+ # # files and directories to backup
101
+ # files "/home/git/repositories"
102
+ # end
103
+
104
+ # archive "etc-files" do
105
+ # files "/etc"
106
+ # # exlude those files/directories
107
+ # exclude "/etc/puppet/other"
108
+ # end
109
+
110
+ # archive "dot-configs" do
111
+ # files "/home/*/.[^.]*"
112
+ # end
113
+
114
+ # archive "blog" do
115
+ # files "/var/www/blog.astrails.com/"
116
+ # # specify multiple files/directories as array
117
+ # exclude ["/var/www/blog.astrails.com/log", "/var/www/blog.astrails.com/tmp"]
118
+ # end
119
+
120
+ # archive "site" do
121
+ # files "/var/www/astrails.com/"
122
+ # exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"]
123
+ # end
124
+
125
+ # archive :misc do
126
+ # files [ "/backup/*.rb" ]
127
+ # end
128
+ end
129
+
130
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: webbynode-safe
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.5
5
+ platform: ruby
6
+ authors:
7
+ - Astrails Ltd.
8
+ - Mark Mansour
9
+ - Felipe Coury
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2009-10-09 00:00:00 -03:00
15
+ default_executable: astrails-safe
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: aws-s3
19
+ type: :runtime
20
+ version_requirement:
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "0"
26
+ version:
27
+ - !ruby/object:Gem::Dependency
28
+ name: net-sftp
29
+ type: :runtime
30
+ version_requirement:
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ version:
37
+ description: Simple tool to backup databases (MySQL, PostgreSQL and MongoDB) and filesystem locally or to Amazon S3 (with optional encryption)
38
+ email: we@astrails.com
39
+ executables:
40
+ - astrails-safe
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - LICENSE
45
+ - README.markdown
46
+ files:
47
+ - LICENSE
48
+ - README.markdown
49
+ - Rakefile
50
+ - VERSION.yml
51
+ - bin/astrails-safe
52
+ - examples/example_helper.rb
53
+ - examples/integration/archive_integration_example.rb
54
+ - examples/integration/cleanup_example.rb
55
+ - examples/unit/archive_example.rb
56
+ - examples/unit/config_example.rb
57
+ - examples/unit/gpg_example.rb
58
+ - examples/unit/gzip_example.rb
59
+ - examples/unit/local_example.rb
60
+ - examples/unit/mysqldump_example.rb
61
+ - examples/unit/pgdump_example.rb
62
+ - examples/unit/s3_example.rb
63
+ - examples/unit/svndump_example.rb
64
+ - lib/astrails/safe.rb
65
+ - lib/astrails/safe/archive.rb
66
+ - lib/astrails/safe/backup.rb
67
+ - lib/astrails/safe/config/builder.rb
68
+ - lib/astrails/safe/config/node.rb
69
+ - lib/astrails/safe/gpg.rb
70
+ - lib/astrails/safe/gzip.rb
71
+ - lib/astrails/safe/local.rb
72
+ - lib/astrails/safe/multi.rb
73
+ - lib/astrails/safe/mysqldump.rb
74
+ - lib/astrails/safe/mongodbdump.rb
75
+ - lib/astrails/safe/pgdump.rb
76
+ - lib/astrails/safe/pipe.rb
77
+ - lib/astrails/safe/s3.rb
78
+ - lib/astrails/safe/sftp.rb
79
+ - lib/astrails/safe/sink.rb
80
+ - lib/astrails/safe/source.rb
81
+ - lib/astrails/safe/stream.rb
82
+ - lib/astrails/safe/svndump.rb
83
+ - lib/astrails/safe/tmp_file.rb
84
+ - lib/extensions/mktmpdir.rb
85
+ - templates/script.rb
86
+ has_rdoc: true
87
+ homepage: http://blog.astrails.com/astrails-safe
88
+ licenses: []
89
+
90
+ post_install_message:
91
+ rdoc_options:
92
+ - --charset=UTF-8
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
100
+ version:
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ version:
107
+ requirements: []
108
+
109
+ rubyforge_project:
110
+ rubygems_version: 1.3.5
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: Backup filesystem and databases (MySQL, PostgreSQL and MongoDB) to Amazon S3 (with encryption)
114
+ test_files:
115
+ - examples/example_helper.rb
116
+ - examples/integration/archive_integration_example.rb
117
+ - examples/integration/cleanup_example.rb
118
+ - examples/unit/archive_example.rb
119
+ - examples/unit/config_example.rb
120
+ - examples/unit/gpg_example.rb
121
+ - examples/unit/gzip_example.rb
122
+ - examples/unit/local_example.rb
123
+ - examples/unit/mysqldump_example.rb
124
+ - examples/unit/pgdump_example.rb
125
+ - examples/unit/s3_example.rb
126
+ - examples/unit/svndump_example.rb