Class: S3Archive::Postrotate
- Inherits:
-
Object
- Object
- S3Archive::Postrotate
- Includes:
- Logging
- Defined in:
- lib/s3archive/postrotate.rb
Instance Attribute Summary collapse
-
#logfile_path ⇒ Object
readonly
Returns the value of attribute logfile_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(logfile_path) ⇒ Postrotate
constructor
A new instance of Postrotate.
- #run ⇒ Object
Methods included from Logging
Constructor Details
#initialize(logfile_path) ⇒ Postrotate
Returns a new instance of Postrotate.
20 21 22 |
# File 'lib/s3archive/postrotate.rb', line 20 def initialize(logfile_path) @logfile_path = logfile_path end |
Instance Attribute Details
#logfile_path ⇒ Object (readonly)
Returns the value of attribute logfile_path.
19 20 21 |
# File 'lib/s3archive/postrotate.rb', line 19 def logfile_path @logfile_path end |
Class Method Details
.run(logfile_path) ⇒ Object
15 16 17 |
# File 'lib/s3archive/postrotate.rb', line 15 def self.run(logfile_path) new(logfile_path).run end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 |
# File 'lib/s3archive/postrotate.rb', line 24 def run raise "Could not find #{prev_logfile}" unless File.exists?(prev_logfile) bucket = S3Archive.config.bucket logger.info("* Uploading #{prev_logfile} to s3://#{bucket}/#{key}") S3FileSynchronizer.run(prev_logfile, bucket, key) end |