Changeset 165
- Timestamp:
- 01/19/08 13:29:37 (10 months ago)
- Files:
-
- trunk/Changes (modified) (1 diff)
- trunk/lib/Brackup/Target/Amazon.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Changes
r162 r165 1 - added the aws_prefix option to configure multiple backup targets 2 on a single Amazon account. from Alessandro Ranellucci <aar@cpan.org>. 3 1 4 1.05 (august 2, 2007) 2 5 trunk/lib/Brackup/Target/Amazon.pm
r161 r165 9 9 # access_key_id 10 10 # sec_access_key_id 11 # chunk_bucket : $self->{access_key_id} . "-chunks"; 12 # backup_bucket : $self->{access_key_id} . "-backups"; 11 # prefix 12 # chunk_bucket : $self->{prefix} . "-chunks"; 13 # backup_bucket : $self->{prefix} . "-backups"; 13 14 # 14 15 … … 21 22 $self->{sec_access_key_id} = $confsec->value("aws_secret_access_key") 22 23 or die "No 'aws_secret_access_key'"; 24 $self->{prefix} = $confsec->value("aws_prefix") || $self->{access_key_id}; 23 25 24 26 $self->_common_s3_init; … … 42 44 sub _common_s3_init { 43 45 my $self = shift; 44 $self->{chunk_bucket} = $self->{ access_key_id} . "-chunks";45 $self->{backup_bucket} = $self->{ access_key_id} . "-backups";46 $self->{chunk_bucket} = $self->{prefix} . "-chunks"; 47 $self->{backup_bucket} = $self->{prefix} . "-backups"; 46 48 $self->{s3} = Net::Amazon::S3->new({ 47 49 aws_access_key_id => $self->{access_key_id}, … … 67 69 my $sec_accesskey = ($ENV{'AWS_SEC_KEY'} || _prompt("Your Amazon AWS secret access key? ")) 68 70 or die "Need your Amazon secret access key.\n"; 71 my $prefix = ($ENV{'AWS_PREFIX'} || _prompt("Your Amazon AWS prefix? (Leave empty if none) ")); 69 72 70 73 my $self = bless {}, $class; 71 74 $self->{access_key_id} = $accesskey; 72 75 $self->{sec_access_key_id} = $sec_accesskey; 76 $self->{prefix} = $prefix || $self->{access_key_id}; 73 77 $self->_common_s3_init; 74 78 return $self; … … 208 212 aws_access_key_id = ... 209 213 aws_secret_access_key = .... 214 aws_prefix = .... 210 215 211 216 =head1 CONFIG OPTIONS 212 217 218 All options may be omitted unless specified. 219 213 220 =over 214 221 215 222 =item B<type> 216 223 217 Must be "B<Amazon>".224 I<(Mandatory.)> Must be "B<Amazon>". 218 225 219 226 =item B<aws_access_key_id> 220 227 221 Your Amazon Web Services access key id.228 I<(Mandatory.)> Your Amazon Web Services access key id. 222 229 223 230 =item B<aws_secret_access_key> 224 231 225 Your Amazon Web Services secret password for the above access key. (not your Amazon password) 232 I<(Mandatory.)> Your Amazon Web Services secret password for the above access key. (not your Amazon password) 233 234 =item B<aws_prefix> 235 236 If you want to setup multiple backup targets on a single Amazon account you can 237 use different prefixes. This string is used to name the S3 buckets created by 238 Brackup. If not specified it defaults to the AWS access key id. 226 239 227 240 =back
