astrails-safe 0.1.2 → 0.1.3
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.
- data/Rakefile +1 -0
- data/VERSION.yml +1 -1
- data/templates/script.rb +109 -0
- metadata +2 -1
data/Rakefile
CHANGED
@@ -10,6 +10,7 @@ begin
|
|
10
10
|
gem.email = "we@astrails.com"
|
11
11
|
gem.homepage = "http://github.com/astrails/safe"
|
12
12
|
gem.authors = ["Astrails Ltd."]
|
13
|
+
gem.files = FileList["[A-Z]*.*", "{bin,examples,generators,lib,rails,spec,test,templates}/**/*", 'Rakefile', 'LICENSE*']
|
13
14
|
|
14
15
|
gem.add_dependency("aws-s3")
|
15
16
|
|
data/VERSION.yml
CHANGED
data/templates/script.rb
ADDED
@@ -0,0 +1,109 @@
|
|
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
|
26
|
+
|
27
|
+
## uncomment to enable GPG encryption.
|
28
|
+
## Note: you can use public 'key' or symmetric password but not both!
|
29
|
+
# gpg do
|
30
|
+
# # key "backup@astrails.com"
|
31
|
+
# password "astrails"
|
32
|
+
# end
|
33
|
+
|
34
|
+
## uncomment to enable backup rotation. keep only given number of latest
|
35
|
+
## backups. remove the rest
|
36
|
+
# keep do
|
37
|
+
# local 4 # keep 4 local backups
|
38
|
+
# s3 20 # keep 20 S3 backups
|
39
|
+
# end
|
40
|
+
|
41
|
+
# backup mysql databases with mysqldump
|
42
|
+
mysqldump do
|
43
|
+
# you can override any setting from parent in a child:
|
44
|
+
options "-ceKq --single-transaction --create-options"
|
45
|
+
|
46
|
+
user "astrails"
|
47
|
+
password ""
|
48
|
+
# host "localhost"
|
49
|
+
# port 3306
|
50
|
+
socket "/var/run/mysqld/mysqld.sock"
|
51
|
+
|
52
|
+
# database is a 'collection' element. it must have a hash or block parameter
|
53
|
+
# it will be 'collected' in a 'databases', with database id (1st arg) used as hash key
|
54
|
+
# the following code will create mysqldump/databases/blog and mysqldump/databases/mysql ocnfiguration 'nodes'
|
55
|
+
|
56
|
+
# backup database with default values
|
57
|
+
# database :blog
|
58
|
+
|
59
|
+
# backup overriding some values
|
60
|
+
# database :production do
|
61
|
+
# # you can override 'partially'
|
62
|
+
# keep :local => 3
|
63
|
+
# # keep/local is 3, and keep/s3 is 20 (from parent)
|
64
|
+
|
65
|
+
# # local override for gpg password
|
66
|
+
# gpg do
|
67
|
+
# password "custom-production-pass"
|
68
|
+
# end
|
69
|
+
|
70
|
+
# skip_tables [:logger_exceptions, :request_logs] # skip those tables during backup
|
71
|
+
# end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
tar do
|
77
|
+
# 'archive' is a collection item, just like 'database'
|
78
|
+
# archive "git-repositories" do
|
79
|
+
# # files and directories to backup
|
80
|
+
# files "/home/git/repositories"
|
81
|
+
# end
|
82
|
+
|
83
|
+
# archive "etc-files" do
|
84
|
+
# files "/etc"
|
85
|
+
# # exlude those files/directories
|
86
|
+
# exclude "/etc/puppet/other"
|
87
|
+
# end
|
88
|
+
|
89
|
+
# archive "dot-configs" do
|
90
|
+
# files "/home/*/.[^.]*"
|
91
|
+
# end
|
92
|
+
|
93
|
+
# archive "blog" do
|
94
|
+
# files "/var/www/blog.astrails.com/"
|
95
|
+
# # specify multiple files/directories as array
|
96
|
+
# exclude ["/var/www/blog.astrails.com/log", "/var/www/blog.astrails.com/tmp"]
|
97
|
+
# end
|
98
|
+
|
99
|
+
# archive "site" do
|
100
|
+
# files "/var/www/astrails.com/"
|
101
|
+
# exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"]
|
102
|
+
# end
|
103
|
+
|
104
|
+
# archive :misc do
|
105
|
+
# files [ "/backup/*.rb" ]
|
106
|
+
# end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: astrails-safe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Astrails Ltd.
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/astrails/safe/stream.rb
|
53
53
|
- lib/astrails/safe/tmp_file.rb
|
54
54
|
- lib/extensions/mktmpdir.rb
|
55
|
+
- templates/script.rb
|
55
56
|
has_rdoc: true
|
56
57
|
homepage: http://github.com/astrails/safe
|
57
58
|
post_install_message:
|