Sha256: 8163461290b50e087715f6a688743a6f0e42d30f3c89518bf451f2ee0f8719ba

Contents?: true

Size: 536 Bytes

Versions: 18

Compression:

Stored size: 536 Bytes

Contents

# -*- coding: utf-8 -*-
require 'rbatch'
require 'fileutils'
require 'date'

RBatch::Log.new do |log|
  log.info("Start---------------")
  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 + " to " + target_dir)
        FileUtils.cp(file,target_dir)
      else
        log.info("Skip " + file + " (already backuped)")
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rbatch-2.1.5 sample/bin/log_backup.rb
rbatch-2.1.4 sample/bin/log_backup.rb
rbatch-2.1.3 sample/bin/log_backup.rb
rbatch-2.1.2 sample/bin/log_backup.rb
rbatch-2.1.1 sample/bin/log_backup.rb
rbatch-2.1.0 sample/bin/log_backup.rb
rbatch-2.0.0 sample/bin/log_backup.rb
rbatch-1.13.1 sample/bin/log_backup.rb
rbatch-1.13.0 sample/bin/log_backup.rb
rbatch-1.12.3 sample/bin/log_backup.rb
rbatch-1.12.2 sample/bin/log_backup.rb
rbatch-1.12.1 sample/bin/log_backup.rb
rbatch-1.12.0 sample/bin/log_backup.rb
rbatch-1.11.0 sample/bin/log_backup.rb
rbatch-1.10.0 sample/bin/log_backup.rb
rbatch-1.9.0 sample/bin/log_backup.rb
rbatch-1.8.0 sample/bin/log_backup.rb
rbatch-1.7.0 sample/bin/log_backup.rb