rmybackup 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rmybackup CHANGED
@@ -51,19 +51,21 @@ end
51
51
  #The first remaining ARGV, we'll take as a command
52
52
  command = ARGV.shift
53
53
 
54
- #Load up the config file. This will exit 1 if the config file can't be found
55
- RMyBackup::Base.load_config(options[:config_file])
56
54
 
57
55
  #Evaluate edit or list options
58
56
  if options[:list]
59
- RMyBackup.list_config_file
57
+ RMyBackup.list_config_file(File.expand_path(options[:config_file]))
60
58
  exit 0
61
59
  end
62
60
 
63
61
  if options[:edit]
64
- RMyBackup.edit_config_file
62
+ RMyBackup.edit_config_file(File.expand_path(config_file))
65
63
  exit 0
66
64
  end
67
65
 
66
+ #Load up the config file. This will exit 1 if the config file can't be found
67
+ RMyBackup::Base.load_config(options[:config_file])
68
+
69
+
68
70
  #Run the backups
69
71
  RMyBackup::Backup.run
@@ -3,7 +3,7 @@ module RMyBackup
3
3
  def self.install_config(file=false)
4
4
  #Default the file location
5
5
  if not file
6
- if File.writable_real?("/etc/rmybackup.conf")
6
+ if File.writable_real?("/etc/")
7
7
  file = "/etc/rmybackup.conf"
8
8
  else
9
9
  file = "~/.rmybackup.conf"
@@ -46,10 +46,14 @@ module RMyBackup
46
46
  end
47
47
  end
48
48
 
49
- def self.list_config_file
49
+ def self.list_config_file(file)
50
50
  if editor
51
- config = RMyBackup::Base.get_config
52
- file = config['file']
51
+
52
+ #See if the config file exists
53
+ if not File.exists? file
54
+ puts "The config file cannot be found: #{file}"
55
+ end
56
+
53
57
  puts "Showing config file - #{file}:\n"
54
58
  File.open(file, "r") do |infile|
55
59
  while(line = infile.gets)
@@ -62,10 +66,15 @@ module RMyBackup
62
66
  end
63
67
  end
64
68
 
65
- def self.edit_config_file
66
- config = RMyBackup::Base.get_config
69
+ def self.edit_config_file(file)
70
+
71
+ #See if the config file exists
72
+ if not File.exists? file
73
+ puts "The config file cannot be found: #{file}"
74
+ end
75
+
67
76
  if editor
68
- exec "#{editor} #{config['file']}"
77
+ exec "#{editor} #{file}"
69
78
  else
70
79
  puts "Can't locate vim and $EDITOR isn't set"
71
80
  exit 1
@@ -14,7 +14,7 @@ module RMyBackup
14
14
  push += "/" if push[-1,1] != "/"
15
15
 
16
16
  puts "\nPushing to : #{push} -->\n\n"
17
- system "#{rsync_command} -rz --delete #{@config['backup_dir']}/ #{push}"
17
+ system "#{rsync_command} -rtz --delete #{@config['backup_dir']}/ #{push}"
18
18
  end
19
19
 
20
20
  end
data/lib/rmybackup.rb CHANGED
@@ -11,5 +11,5 @@ require File.expand_path('../rmybackup/push',__FILE__)
11
11
 
12
12
  #Set the version
13
13
  module RMyBackup
14
- GEM_VERSION = "0.3.5"
14
+ GEM_VERSION = "0.3.6"
15
15
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 5
9
- version: 0.3.5
8
+ - 6
9
+ version: 0.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bryan Shelton
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-13 00:00:00 -06:00
17
+ date: 2010-07-15 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency