Class: RMyBackup::Push

Inherits:
Object
  • Object
show all
Defined in:
lib/rmybackup/push.rb

Class Method Summary collapse

Class Method Details

.runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rmybackup/push.rb', line 4

def run
  #Load the config options
  @config = RMyBackup::Base.get_config
  
  #Iterrate through the pushes in the @config options
  @config['push'].each do |push|
    #Define the rsync_command from the @config option
    rsync_command = @config['rsync_command']
    
    #Add a trailing slash if not present
    push += "/" if push[-1,1] != "/"
    
    puts "\nPushing to : #{push} -->\n\n"
    system "#{rsync_command} -rtz --delete #{@config['backup_dir']}/ #{push}"
  end
  
end