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 CHANGED
@@ -1,9 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Set environment if these paths exist
4
- gems = File.expand_path("/etc/profile")
5
- if File.exists?(gems)
6
- `. /etc/profile`
7
- end
8
-
9
3
  require 'dreamback'
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Dreamback
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul R Alexander