s3-mysql-backup 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +14 -0
  2. data/bin/s3-mysql-backup +41 -0
  3. metadata +4 -2
data/README.md CHANGED
@@ -15,6 +15,15 @@ Local and S3 backups are retained at this schedule:
15
15
  - keep 90 days weekly beyond that
16
16
  - keep only monthly after that
17
17
 
18
+ The email summary is a short email like:
19
+
20
+ From: my-user@gmail.com
21
+ To: my-recipient@example.com
22
+ Date: 2012-12-22
23
+ Subject: sql backup: my_database_name: 42.0 MB
24
+
25
+ my_database_name.20121222.170134.sql.gz
26
+
18
27
 
19
28
  ## Configuration
20
29
 
@@ -57,6 +66,11 @@ gmail_pass: gmail-password
57
66
  S3MysqlBackup.new('database_name', '/path/to/s3-mysql-backup-config.yml').run
58
67
 
59
68
 
69
+ ## Todo
70
+
71
+ Write tests
72
+
73
+
60
74
  ## Credits
61
75
 
62
76
  2008+ Seventh Compass
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ # require 'ruby-debug'
6
+ $:.unshift File.expand_path("../../lib", __FILE__)
7
+
8
+ require 's3-mysql-backup'
9
+
10
+ def die(msg)
11
+ puts "ERROR: #{msg}"
12
+ exit 1
13
+ end
14
+
15
+ def usage
16
+ puts <<-END
17
+ Usage: s3-mysql-backup [OPTIONS] CONFIG_FILE
18
+ Options:
19
+ -h, --help This help screen
20
+ -d, --database The database name to back up
21
+
22
+ END
23
+ exit 1
24
+ end
25
+
26
+ def process_options
27
+ usage if ARGV.delete("-h") || ARGV.delete("--help")
28
+ $DATABASE = ARGV.delete("-d") || ARGV.delete("--database")
29
+ usage unless ARGV.first
30
+ $CONFIG_FILE_NAME = File.expand_path(ARGV.first)
31
+ end
32
+
33
+ def main
34
+ process_options
35
+
36
+ die "Missing configuration file." unless File.exists?($CONFIG_FILE_NAME)
37
+
38
+ S3MysqlBackup.new($DATABASE, $CONFIG_FILE_NAME).run
39
+ end
40
+
41
+ main
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3-mysql-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -29,7 +29,8 @@ dependencies:
29
29
  version: '0'
30
30
  description: A simple mysql backup to Amazon S3
31
31
  email: jeff@7compass.com
32
- executables: []
32
+ executables:
33
+ - s3-mysql-backup
33
34
  extensions: []
34
35
  extra_rdoc_files: []
35
36
  files:
@@ -37,6 +38,7 @@ files:
37
38
  - lib/s3_mysql_backup.rb
38
39
  - lib/s3utils.rb
39
40
  - README.md
41
+ - bin/s3-mysql-backup
40
42
  homepage: https://github.com/7compass/s3-mysql-backup
41
43
  licenses: []
42
44
  post_install_message: