dreamback 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/dreamback +0 -6
- data/lib/dreamback/initializer.rb +8 -1
- data/lib/dreamback/version.rb +1 -1
- metadata +3 -3
data/bin/dreamback
CHANGED
@@ -69,9 +69,16 @@ module Dreamback
|
|
69
69
|
setup_cron = agree(bold("Would you like to add a cron job to automatically run the backup? [y/n]: "))
|
70
70
|
if setup_cron
|
71
71
|
crontab_email = ask("Dreamhost requires an email address to send crontab output to, please provide one: ") { |q| q.validate = /\b[A-Za-z0-9._%-\+]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b/ }
|
72
|
+
|
73
|
+
# Set environment if these paths exist
|
74
|
+
gems = File.expand_path("/etc/profile")
|
75
|
+
if File.exists?(gems)
|
76
|
+
cron_profile = ". /etc/profile &&"
|
77
|
+
end
|
78
|
+
|
72
79
|
ct = File.open(File.expand_path("~/.dreamback_crontab"), "w+")
|
73
80
|
ct << "MAILTO=#{crontab_email}\n"
|
74
|
-
ct << "0 1 * * * dreamback backup"
|
81
|
+
ct << "0 1 * * * #{cron_profile} dreamback backup"
|
75
82
|
ct.close
|
76
83
|
`crontab #{ct.path}`
|
77
84
|
File.delete(ct.path)
|
data/lib/dreamback/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dreamback
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul R Alexander
|