Sha256: dc852cf3d9248c7381785b6c4a15a7e9b155415339d0f1d0b222e8c95481c956

Contents?: true

Size: 506 Bytes

Versions: 71

Compression:

Stored size: 506 Bytes

Contents

class Specinfra::Command::Base::Cron < Specinfra::Command::Base
  class << self
    def check_has_entry(user, entry)
      entry_escaped = entry.gsub(/\\/, '\\\\\\').gsub(/\*/, '\\*').gsub(/\[/, '\\[').gsub(/\]/, '\\]')
      grep_command = "grep -v '^[[:space:]]*#' | grep -- ^#{escape(entry_escaped)}$"
      if user.nil?
        "crontab -l | #{grep_command}"
      else
        "crontab -u #{escape(user)} -l | #{grep_command}"
      end
    end

    def get_table
      'crontab -l'
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
specinfra-2.73.0 lib/specinfra/command/base/cron.rb
specinfra-2.72.1 lib/specinfra/command/base/cron.rb
specinfra-2.72.0 lib/specinfra/command/base/cron.rb
specinfra-2.71.3 lib/specinfra/command/base/cron.rb
specinfra-2.71.2 lib/specinfra/command/base/cron.rb
specinfra-2.71.1 lib/specinfra/command/base/cron.rb
specinfra-2.71.0 lib/specinfra/command/base/cron.rb
specinfra-2.70.2 lib/specinfra/command/base/cron.rb
specinfra-2.70.1 lib/specinfra/command/base/cron.rb
specinfra-2.70.0 lib/specinfra/command/base/cron.rb
specinfra-2.69.0 lib/specinfra/command/base/cron.rb
specinfra-2.68.2 lib/specinfra/command/base/cron.rb
specinfra-2.68.1 lib/specinfra/command/base/cron.rb
specinfra-2.68.0 lib/specinfra/command/base/cron.rb
specinfra-2.67.10 lib/specinfra/command/base/cron.rb
specinfra-2.67.9 lib/specinfra/command/base/cron.rb
specinfra-2.67.8 lib/specinfra/command/base/cron.rb
specinfra-2.67.7 lib/specinfra/command/base/cron.rb
specinfra-2.67.6 lib/specinfra/command/base/cron.rb
specinfra-2.67.5 lib/specinfra/command/base/cron.rb