Sha256: ffbff61fb841f8baa44e09cb3825b1f7830db91e65a8c54c411e812521ab673c
Contents?: true
Size: 863 Bytes
Versions: 92
Compression:
Stored size: 863 Bytes
Contents
require 'flydata/command/base' require 'flydata/log_monitor' module Flydata module Command class Routine < Base def run print "#{Time.now} " unless flydata.credentials.authenticated? raise "Authentication error. Please login." end log_paths = retrieve_log_paths log_paths and log_paths.size() > 0 and log_paths.each { |path| if File.exist?(path) and File.writable?(path) puts "Start - #{path}. " Flydata::LogMonitor.new(path).setup.rotate else puts "Skip - #{path}. System cannot access this path." end } end private def retrieve_log_paths data_entries = retrieve_data_entries data_entries.map {|e| e['log_path'] if e['log_deletion'] }.compact end end end end
Version data entries
92 entries across 92 versions & 1 rubygems