Sha256: 3bd7300527387450670ce3be2978db2305d4e8ac7679193a2e0f3face478171d

Contents?: true

Size: 478 Bytes

Versions: 12

Compression:

Stored size: 478 Bytes

Contents

require 'rbatch'

RBatch::Log.new do |log|
  require 'fileutils'
  require 'date'
  target_dir = RBatch::config["target_dir"]
  RBatch::config["file_list"].each do |file_wildcard|
    Dir::glob(file_wildcard).each do |file|
      if ! File.exists?(File.join(target_dir,File.basename(file)))
        log.info("Copy " + file + " " + target_dir)
        FileUtils.cp(file,target_dir)
      else
        log.info("Skip " + file + " (already backuped)")
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rbatch-2.6.1 sample/bin/log_backup.rb
rbatch-2.6.0 sample/bin/log_backup.rb
rbatch-2.5.1 sample/bin/log_backup.rb
rbatch-2.5.0 sample/bin/log_backup.rb
rbatch-2.4.0 sample/bin/log_backup.rb
rbatch-2.3.1 sample/bin/log_backup.rb
rbatch-2.3.0 sample/bin/log_backup.rb
rbatch-2.2.0 sample/bin/log_backup.rb
rbatch-2.1.9 sample/bin/log_backup.rb
rbatch-2.1.8 sample/bin/log_backup.rb
rbatch-2.1.7 sample/bin/log_backup.rb
rbatch-2.1.6 sample/bin/log_backup.rb