db2fog 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +11 -3
  2. data/lib/db2fog.rb +1 -1
  3. data/lib/db2fog/tasks.rb +19 -4
  4. metadata +17 -17
@@ -74,11 +74,19 @@ pg_version 8 or 9
74
74
  == Usage
75
75
 
76
76
  # Add to your crontab or whatever
77
- rake db2fog:backup:full
77
+ rake db2fog:full
78
78
 
79
79
  # Handy tasks
80
- rake db2fog:backup:restore # You should be testing this regularly
81
- rake db2fog:backup:clean # Clean up old backups - cron this
80
+ rake db2fog:restore # You should be testing this regularly
81
+ rake db2fog:clean # Clean up old backups - cron this
82
+
83
+ === Alternative
84
+
85
+ If you want to trigger backups from ruby (say, from a delayed job) you can
86
+ do this:
87
+
88
+ DB2Fog.new.backup
89
+ DB2Fog.new.clean
82
90
 
83
91
  == Compatibility
84
92
 
@@ -10,7 +10,7 @@ require 'db2fog/railtie'
10
10
  class DB2Fog
11
11
  cattr_accessor :config
12
12
 
13
- def full_backup
13
+ def backup
14
14
  file_name = "dump-#{db_credentials[:database]}-#{Time.now.utc.strftime("%Y%m%d%H%M")}.sql.gz"
15
15
  store.store(file_name, open(database.dump))
16
16
  store.store(most_recent_dump_file_name, file_name)
@@ -1,19 +1,34 @@
1
1
  # coding: utf-8
2
2
 
3
3
  namespace :db2fog do
4
+ desc "Save a full back to S3"
5
+ task :backup => :environment do
6
+ DB2Fog.new.backup
7
+ end
8
+
9
+ desc "Restore your DB from S3"
10
+ task :restore => :environment do
11
+ DB2Fog.new.restore
12
+ end
13
+
14
+ desc "Keep all backups for the last day, one per day for the last week, and one per week before that. Delete the rest."
15
+ task :clean => :environment do
16
+ DB2Fog.new.clean
17
+ end
18
+
4
19
  namespace :backup do
5
- desc "Save a full back to S3"
6
20
  task :full => :environment do
7
- DB2Fog.new.full_backup
21
+ $stderr.puts "the db2fog:backup:full rake task is deprecated, use db2fog:backup instead"
22
+ DB2Fog.new.backup
8
23
  end
9
24
 
10
- desc "Restore your DB from S3"
11
25
  task :restore => :environment do
26
+ $stderr.puts "the db2fog:backup:restore rake task is deprecated, use db2fog:restore instead"
12
27
  DB2Fog.new.restore
13
28
  end
14
29
 
15
- desc "Keep all backups for the last day, one per day for the last week, and one per week before that. Delete the rest."
16
30
  task :clean => :environment do
31
+ $stderr.puts "the db2fog:backup:clean rake task is deprecated, use db2fog:clean instead"
17
32
  DB2Fog.new.clean
18
33
  end
19
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db2fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-24 00:00:00.000000000 Z
12
+ date: 2011-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &23501480 !ruby/object:Gem::Requirement
16
+ requirement: &22595540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *23501480
24
+ version_requirements: *22595540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activerecord
27
- requirement: &24626880 !ruby/object:Gem::Requirement
27
+ requirement: &22611460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *24626880
35
+ version_requirements: *22611460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: fog
38
- requirement: &24678760 !ruby/object:Gem::Requirement
38
+ requirement: &22611000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *24678760
46
+ version_requirements: *22611000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &24690660 !ruby/object:Gem::Requirement
49
+ requirement: &22610620 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *24690660
57
+ version_requirements: *22610620
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mysql2
60
- requirement: &24689120 !ruby/object:Gem::Requirement
60
+ requirement: &22610160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *24689120
68
+ version_requirements: *22610160
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &24699980 !ruby/object:Gem::Requirement
71
+ requirement: &22609660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '2.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *24699980
79
+ version_requirements: *22609660
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: timecop
82
- requirement: &24715360 !ruby/object:Gem::Requirement
82
+ requirement: &22609160 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: 0.3.5
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *24715360
90
+ version_requirements: *22609160
91
91
  description: db2fog provides rake tasks for backing up and restoring your DB to cloud
92
92
  storage providers
93
93
  email:
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: 1.3.2
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 1.8.10
127
+ rubygems_version: 1.8.11
128
128
  signing_key:
129
129
  specification_version: 3
130
130
  summary: db2fog provides rake tasks for backing up and restoring your DB to cloud