Class: Backup::Storage::S3
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Amazon Simple Storage Service (S3) Credentials.
-
#bucket ⇒ Object
Amazon S3 bucket name and path.
-
#path ⇒ Object
Amazon S3 bucket name and path.
-
#region ⇒ Object
Region of the specified S3 bucket.
-
#secret_access_key ⇒ Object
Amazon Simple Storage Service (S3) Credentials.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ S3
constructor
Creates a new instance of the Amazon S3 storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults.
-
#perform! ⇒ Object
Performs the backup transfer.
-
#provider ⇒ Object
This is the provider that Fog uses for the S3 Storage.
-
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored.
Methods inherited from Base
#cycle!, #local_file, #local_path, #remote_file
Methods included from Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Constructor Details
#initialize(&block) ⇒ S3
Creates a new instance of the Amazon S3 storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults
Currently available regions:
eu-west-1, us-east-1, ap-southeast-1, us-west-1
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/backup/storage/s3.rb', line 30 def initialize(&block) load_defaults! @path ||= 'backups' instance_eval(&block) if block_given? @path = path.sub(/^\//, '') @time = TIME end |
Instance Attribute Details
#access_key_id ⇒ Object
Amazon Simple Storage Service (S3) Credentials
13 14 15 |
# File 'lib/backup/storage/s3.rb', line 13 def access_key_id @access_key_id end |
#bucket ⇒ Object
Amazon S3 bucket name and path
17 18 19 |
# File 'lib/backup/storage/s3.rb', line 17 def bucket @bucket end |
#path ⇒ Object
Amazon S3 bucket name and path
17 18 19 |
# File 'lib/backup/storage/s3.rb', line 17 def path @path end |
#region ⇒ Object
Region of the specified S3 bucket
21 22 23 |
# File 'lib/backup/storage/s3.rb', line 21 def region @region end |
#secret_access_key ⇒ Object
Amazon Simple Storage Service (S3) Credentials
13 14 15 |
# File 'lib/backup/storage/s3.rb', line 13 def secret_access_key @secret_access_key end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
55 56 57 58 |
# File 'lib/backup/storage/s3.rb', line 55 def perform! transfer! cycle! end |
#provider ⇒ Object
This is the provider that Fog uses for the S3 Storage
49 50 51 |
# File 'lib/backup/storage/s3.rb', line 49 def provider 'AWS' end |
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored
43 44 45 |
# File 'lib/backup/storage/s3.rb', line 43 def remote_path File.join(path, TRIGGER, '/') end |