Class: S3ckup::Backup
- Inherits:
-
Object
- Object
- S3ckup::Backup
- Defined in:
- lib/s3ckup/backup.rb
Instance Method Summary collapse
-
#initialize(key_id, access_key, logger = Logger.new) ⇒ Backup
constructor
A new instance of Backup.
- #run(bucket_name, folders) ⇒ Object
Constructor Details
#initialize(key_id, access_key, logger = Logger.new) ⇒ Backup
Returns a new instance of Backup.
4 5 6 7 |
# File 'lib/s3ckup/backup.rb', line 4 def initialize(key_id, access_key, logger = Logger.new) @logger = logger @s3_manager = S3Mananger.new(key_id, access_key, @logger) end |
Instance Method Details
#run(bucket_name, folders) ⇒ Object
9 10 11 12 13 |
# File 'lib/s3ckup/backup.rb', line 9 def run(bucket_name, folders) local_files = Manifest.new(folders.flatten) remote_files = @s3_manager.fetch_manifest(bucket_name) backup(bucket_name, remote_files, local_files) end |