Method: Panoramix::Plugin::S3#timestamp

Defined in:
lib/panoramix/plugin/s3.rb

#timestampObject

Return current timestamp



19
20
21
22
23
24
25
26
27
# File 'lib/panoramix/plugin/s3.rb', line 19

def timestamp
  return Time.at 0 unless created?
  remote_time = shell("aws s3 ls --summarize #{@src} | head -n1 | awk 'END {print $1, $2}'", true)[:out]
  while remote_time == " \n"
    sleep 1
    remote_time = shell("aws s3 ls --summarize #{@src} | head -n1 | awk 'END {print $1, $2}'", true)[:out]
  end
  remote_time = Time.parse(remote_time)
end